SlideShare a Scribd company logo
Click here to _START_
about.me

• Lead Game Designer/Dev - QONQR
• Independent Consultant – MS Stack
• Leadership Team – Twin Cities Code Camp
• Co-Leader – Twin Cities .Net User Group
• Level 80 Draenei Enhancement Shaman (retired)


• (@apickett != Accountant || Lawyer || Fortune Teller || Diamond Level
  Starcraft II)
I can haz Shared Dev DB?
Local Dev DBs = happy devs :D
…Until Integration timez
What we’ll cover
• SQL under Source Control
                                                          20% effort
 •       Check in Schema, Ref Data, Migration Scripts   BIG REWARD!
 •       Revision History
 •       Merge Conflicts




• Database Continuous Integration & Deploy                80% effort
 •       Automated Builds                                MEGA REALLY
 •       Automated Database Deploy                      HUGE REWARD!
     •     from Source Control to target environment
K. Scott Allen – Three Rules for DB work
• 1. Never use a shared database server for development work.
• 2. Always Have a Single, Authoritative Source For Your Schema
• 3. Always Version Your Database




http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-
database-work.aspx
Benefits of DB Source Control

• Same as putting ur codez in SC!
 • Freedom to refactor (safely with rollbacks)
 • Rapid iteration & integration
 • Check in logs & history
  • Schema Compare
  • Data Compare
 • Automated builds and integration tests (correctness)

 • Via Coding Horror: Is Your Database Under Version Control?
 http://www.codinghorror.com/blog/2006/12/is-your-database-under-version-
 control.html
Build vs Buy
As devs we’re wizards capable of magicing up anything.
Friendly adivce: Avoid that temptation (unless it’s your core business)
- Team of 8. ½ a Dev year to maintain and extend custom rolled solution
Microsoft 1st party
Microsoft 1st party
• VS Database projects
 •       VS 2010
     •       Database Project (.dbproj)
     •       Server Project
     •       Data-tier Application (DAC)
         •     http://msdn.microsoft.com/en-us/library/ee240739(SQL.105).aspx
 •       VS2011 = .sqlproj
     •       Moving to Sql Server Developer tools (SSDT) code named "Juneau".
     •       http://msdn.microsoft.com/en-us/magazine/hh394146.aspx

• VS Schema compare
 •       Requires Visual Studio Premium or Ultimate
 •       Command Line VSDBCMD.EXE
Microsoft 1st party
• Dacpac
 •   Serializes DB schema to XML (?)
 •   Versionable, but tricky to do diffs (?)
 •   Targeted at managing handoff of schema between Dev and Prod
 •   Think similar to how IT systems hands off VMs
 •   http://www.slideshare.net/andrewmatthewthompson/sql-aure-and-datatier-
     applications-dacpac

• Bacpac
 •   Extends Dacpac to include Table Data
Off the shelf
Red Gate SQL Compare rom $295.

DB Ghost from $195, recommended by Mike Hadlow here

SQL Change Manager $995 per instance.

SQL Effects Clarity standard ed. from $139; community ed. free.

SQLSourceSafe from $129.

sqlXpress Diff contact for price. :-(

Embarcadero Change Manager contact for price. :-(

Apex SQL Diff from $399

SQL Source Control 2003 from $199

SASSI v2.0 professional from $180 (looks free on their site, but apparently isn't)

Evorex Source # shareware or $299+ (conflicting reports!)

DB maestro

                                                                    Via http://secretgeek.net/dbcontrol.asp (2006!)
Enter Redgate SQL Source Control
Redgate
• Sql Source Control (~$250 per seat)
                                         20% effort
                                         AND cost!




• Sql Toolbelt (~$1500 per seat)          80% effort
 •   Sql Compare                           and cost
 •   Sql Data Compare                   (but worth it!)
 •   Sql Data Generator
 •   Sql Azure Backup (free)
DEMO!
Conflicts
Continuous Integration
• Build Scripting
 •   MSBuild
 •   Nant
 •   Powershell

• CI build servers
 •   Team City
 •   Cruise Control
 •   Jenkins (formerly Hudson)
 •   Team Foundation Server
Continuous Deployment (Web)
Web Projects
•       MS Web Deploy
    •    Windows Server (Web Management Service - WMSVC)
    •    Windows 7/Vista/XP (MsDepSvc)
    •    Different on IIS 6 vs 7
Continuous Deployment (Data)
Team City -> Auto Deploy Data
Build step 1) Deploy schema

C:Program Files (x86)Red GateSQL Compare 9SQLCompare.exe

/scr1:%teamcity.build.checkoutDir%/Data /server2:(local) /db2:tccc12_prod /Sync
/Include:identical /Report:Report/SchemaDiffReport.html /ReportType:Interactive
/ScriptFile:Report/SchemaSyncScript.sql /Force /Verbose

-------------------

Build step 2)

Deploy Reference Data

C:Program Files (x86)Red GateSQL Data Compare 9SQLDataCompare.exe

/scr1:%teamcity.build.checkoutDir%/Data /server2:(local) /db2:tccc12_prod /Sync
/Include:table:Country /Include:identical /ScriptFile:Report/DataSyncScript.sql /Force /Verbose
Team City - Version Control settings
Mother of all builds vs Linked Build
Take aways
Job 1: Get your Sql under Source Control!


Job 2: Get Sql into your CI builds!


Job 3: Test your Data continuously!


Job 4: Deploy continually!


Job 5: Profit!
Resources
Online
• K Scott Allen: Three Rules for Database Work:
 •   http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-
     work.aspx
• Coding Horror: Is Your Database Under Version Control?
 •   http://www.codinghorror.com/blog/2006/12/is-your-database-under-version-
     control.html
• Troy Hunt – Rocking your SQL Source Control world with Red Gate
 •   http://www.troyhunt.com/2010/07/rocking-your-sql-source-control-world.html
 •   http://www.troyhunt.com/2011/02/automated-database-releases-with.html


Vendors
• Microsoft
• Redgate

More Related Content

PPTX
SQL Server Deployments made easy with DACPAC
PPTX
ETL in data warehouse as a service enviornment
PPTX
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
PPTX
Azure PaaS databases
PDF
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
PPTX
PaaSport to Paradise: Lifting & Shifting with Azure SQL Database/Managed Inst...
PPTX
Blockchain for the DBA and Data Professional
PPTX
How SQL Server 2016 SP1 Changes the Game
SQL Server Deployments made easy with DACPAC
ETL in data warehouse as a service enviornment
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Azure PaaS databases
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
PaaSport to Paradise: Lifting & Shifting with Azure SQL Database/Managed Inst...
Blockchain for the DBA and Data Professional
How SQL Server 2016 SP1 Changes the Game

What's hot (20)

PPTX
PASS VC: SQL Server Performance Monitoring and Baselining
PDF
Exploring T-SQL Anti-Patterns
PPTX
02 integrate highchart
PPTX
Bi and AI updates in the Microsoft Data Platform stack
PPTX
Troubleshooting common scenarios with Always On - A Dress Rehearsal
PPTX
Discovery Day 2019 Sofia - Big data clusters
PPTX
Javascript on Server-Side
PPTX
Blockchain for the DBA and Data Professional
PDF
Moving to the cloud; PaaS, IaaS or Managed Instance
PPTX
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
PPTX
Migrate SQL Server 2008 R2 to Azure Cloud
PPTX
Discovery Day 2019 Sofia - What is new in SQL Server 2019
PPTX
Geek Sync | Taking Your First Steps to the Cloud—Building a Hybrid Model
PPTX
Let's Talk About: Database Migration Service
PPTX
Sql server hybrid what every sql professional should know
PDF
Help, I need to migrate my On Premise Database to Azure, which Database Tier ...
PDF
Azure Days 2019: Infrastructure as Code auf Azure (Jonas Wanninger & Daniel H...
PPTX
Upgrade your SQL Server like a Ninja
PPTX
Tips & Tricks SQL in the City Seattle 2014
PPTX
Azure sql introduction
PASS VC: SQL Server Performance Monitoring and Baselining
Exploring T-SQL Anti-Patterns
02 integrate highchart
Bi and AI updates in the Microsoft Data Platform stack
Troubleshooting common scenarios with Always On - A Dress Rehearsal
Discovery Day 2019 Sofia - Big data clusters
Javascript on Server-Side
Blockchain for the DBA and Data Professional
Moving to the cloud; PaaS, IaaS or Managed Instance
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
Migrate SQL Server 2008 R2 to Azure Cloud
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Geek Sync | Taking Your First Steps to the Cloud—Building a Hybrid Model
Let's Talk About: Database Migration Service
Sql server hybrid what every sql professional should know
Help, I need to migrate my On Premise Database to Azure, which Database Tier ...
Azure Days 2019: Infrastructure as Code auf Azure (Jonas Wanninger & Daniel H...
Upgrade your SQL Server like a Ninja
Tips & Tricks SQL in the City Seattle 2014
Azure sql introduction
Ad

Viewers also liked (18)

PPT
Miscellaneous legal terms domestic and foregin copy
PDF
Afghanistan telecompolicy english
PPTX
第十二組 感測裝置
PPTX
Scarlet hope rev lb2 no video embed
PPTX
9935019
PPTX
9935019
DOC
APARATO GENITAL MASCULINO
PDF
Connect & Create
PPTX
Simple ams slidedeck
PPTX
Foreign investment
PDF
The journey to ICS - Extended
PPT
BIOFISICA 1
PPT
International law of sales (1)
PDF
Psihologia varstelor copilaria
PDF
Ion ways slide presentation
PPT
BIOFISICA 1
PPT
Basics of international business law
PDF
Molcular Hydrogen E Book
Miscellaneous legal terms domestic and foregin copy
Afghanistan telecompolicy english
第十二組 感測裝置
Scarlet hope rev lb2 no video embed
9935019
9935019
APARATO GENITAL MASCULINO
Connect & Create
Simple ams slidedeck
Foreign investment
The journey to ICS - Extended
BIOFISICA 1
International law of sales (1)
Psihologia varstelor copilaria
Ion ways slide presentation
BIOFISICA 1
Basics of international business law
Molcular Hydrogen E Book
Ad

Similar to Sql source control (20)

PPTX
Migrating on premises workload to azure sql database
PPTX
Copy Data Management for the DBA
PPTX
Denver SQL Saturday The Next Frontier
PPTX
Data Handning with Sqlite for Android
PPTX
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
PPTX
Microsoft Cloud BI Update 2012 for SQL Saturday Philly
PDF
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
PDF
Sharepoint Deployments
PDF
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
PDF
44spotkaniePLSSUGWRO_CoNowegowKrainieChmur
PPTX
Building FoundationDB
PPTX
Windows Azure: Lessons From the Field
PPT
Chap3 3 12
PDF
Play Framework and Activator
PDF
Blue Green Sitecore Deployments on Azure
PPTX
Move to azure
PPTX
android sqlite
PPTX
Database automated build and test - SQL In The City Cambridge
PPT
SQL Server 2008 Integration Services
PPT
Evolutionary Database Design
Migrating on premises workload to azure sql database
Copy Data Management for the DBA
Denver SQL Saturday The Next Frontier
Data Handning with Sqlite for Android
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
Microsoft Cloud BI Update 2012 for SQL Saturday Philly
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
Sharepoint Deployments
Lessons from Building Large-Scale, Multi-Cloud, SaaS Software at Databricks
44spotkaniePLSSUGWRO_CoNowegowKrainieChmur
Building FoundationDB
Windows Azure: Lessons From the Field
Chap3 3 12
Play Framework and Activator
Blue Green Sitecore Deployments on Azure
Move to azure
android sqlite
Database automated build and test - SQL In The City Cambridge
SQL Server 2008 Integration Services
Evolutionary Database Design

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Programs and apps: productivity, graphics, security and other tools
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars

Sql source control

  • 1. Click here to _START_
  • 2. about.me • Lead Game Designer/Dev - QONQR • Independent Consultant – MS Stack • Leadership Team – Twin Cities Code Camp • Co-Leader – Twin Cities .Net User Group • Level 80 Draenei Enhancement Shaman (retired) • (@apickett != Accountant || Lawyer || Fortune Teller || Diamond Level Starcraft II)
  • 3. I can haz Shared Dev DB?
  • 4. Local Dev DBs = happy devs :D
  • 6. What we’ll cover • SQL under Source Control 20% effort • Check in Schema, Ref Data, Migration Scripts BIG REWARD! • Revision History • Merge Conflicts • Database Continuous Integration & Deploy 80% effort • Automated Builds MEGA REALLY • Automated Database Deploy HUGE REWARD! • from Source Control to target environment
  • 7. K. Scott Allen – Three Rules for DB work • 1. Never use a shared database server for development work. • 2. Always Have a Single, Authoritative Source For Your Schema • 3. Always Version Your Database http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for- database-work.aspx
  • 8. Benefits of DB Source Control • Same as putting ur codez in SC! • Freedom to refactor (safely with rollbacks) • Rapid iteration & integration • Check in logs & history • Schema Compare • Data Compare • Automated builds and integration tests (correctness) • Via Coding Horror: Is Your Database Under Version Control? http://www.codinghorror.com/blog/2006/12/is-your-database-under-version- control.html
  • 9. Build vs Buy As devs we’re wizards capable of magicing up anything. Friendly adivce: Avoid that temptation (unless it’s your core business) - Team of 8. ½ a Dev year to maintain and extend custom rolled solution
  • 11. Microsoft 1st party • VS Database projects • VS 2010 • Database Project (.dbproj) • Server Project • Data-tier Application (DAC) • http://msdn.microsoft.com/en-us/library/ee240739(SQL.105).aspx • VS2011 = .sqlproj • Moving to Sql Server Developer tools (SSDT) code named "Juneau". • http://msdn.microsoft.com/en-us/magazine/hh394146.aspx • VS Schema compare • Requires Visual Studio Premium or Ultimate • Command Line VSDBCMD.EXE
  • 12. Microsoft 1st party • Dacpac • Serializes DB schema to XML (?) • Versionable, but tricky to do diffs (?) • Targeted at managing handoff of schema between Dev and Prod • Think similar to how IT systems hands off VMs • http://www.slideshare.net/andrewmatthewthompson/sql-aure-and-datatier- applications-dacpac • Bacpac • Extends Dacpac to include Table Data
  • 13. Off the shelf Red Gate SQL Compare rom $295. DB Ghost from $195, recommended by Mike Hadlow here SQL Change Manager $995 per instance. SQL Effects Clarity standard ed. from $139; community ed. free. SQLSourceSafe from $129. sqlXpress Diff contact for price. :-( Embarcadero Change Manager contact for price. :-( Apex SQL Diff from $399 SQL Source Control 2003 from $199 SASSI v2.0 professional from $180 (looks free on their site, but apparently isn't) Evorex Source # shareware or $299+ (conflicting reports!) DB maestro Via http://secretgeek.net/dbcontrol.asp (2006!)
  • 14. Enter Redgate SQL Source Control
  • 15. Redgate • Sql Source Control (~$250 per seat) 20% effort AND cost! • Sql Toolbelt (~$1500 per seat) 80% effort • Sql Compare and cost • Sql Data Compare (but worth it!) • Sql Data Generator • Sql Azure Backup (free)
  • 16. DEMO!
  • 18. Continuous Integration • Build Scripting • MSBuild • Nant • Powershell • CI build servers • Team City • Cruise Control • Jenkins (formerly Hudson) • Team Foundation Server
  • 19. Continuous Deployment (Web) Web Projects • MS Web Deploy • Windows Server (Web Management Service - WMSVC) • Windows 7/Vista/XP (MsDepSvc) • Different on IIS 6 vs 7
  • 20. Continuous Deployment (Data) Team City -> Auto Deploy Data Build step 1) Deploy schema C:Program Files (x86)Red GateSQL Compare 9SQLCompare.exe /scr1:%teamcity.build.checkoutDir%/Data /server2:(local) /db2:tccc12_prod /Sync /Include:identical /Report:Report/SchemaDiffReport.html /ReportType:Interactive /ScriptFile:Report/SchemaSyncScript.sql /Force /Verbose ------------------- Build step 2) Deploy Reference Data C:Program Files (x86)Red GateSQL Data Compare 9SQLDataCompare.exe /scr1:%teamcity.build.checkoutDir%/Data /server2:(local) /db2:tccc12_prod /Sync /Include:table:Country /Include:identical /ScriptFile:Report/DataSyncScript.sql /Force /Verbose
  • 21. Team City - Version Control settings
  • 22. Mother of all builds vs Linked Build
  • 23. Take aways Job 1: Get your Sql under Source Control! Job 2: Get Sql into your CI builds! Job 3: Test your Data continuously! Job 4: Deploy continually! Job 5: Profit!
  • 24. Resources Online • K Scott Allen: Three Rules for Database Work: • http://odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database- work.aspx • Coding Horror: Is Your Database Under Version Control? • http://www.codinghorror.com/blog/2006/12/is-your-database-under-version- control.html • Troy Hunt – Rocking your SQL Source Control world with Red Gate • http://www.troyhunt.com/2010/07/rocking-your-sql-source-control-world.html • http://www.troyhunt.com/2011/02/automated-database-releases-with.html Vendors • Microsoft • Redgate