SlideShare a Scribd company logo
#sqlinthecity 
Automated database build and 
test with TeamCity 
SITC Workshop Cambridge, UK
What is CI? 
#sqlinthecity 
• Continuous Integration (CI) is a development 
practice that requires developers to integrate code 
into a shared repository several times a day. Each 
check-in is then verified by an automated build, 
allowing teams to detect problems early.
What is database CI? 
• It’s the same! 
#sqlinthecity 
• Applying the same approach to the database as we 
do for the application
The road to database CI 
1. Source control 
2. Automated builds 
3. Automated tests 
4. Frequent check ins of small changes 
#sqlinthecity 

The road to database CI 
1. Source control 
2. Automated builds 
3. Automated tests 
4. Frequent check ins of small changes 
#sqlinthecity
Advantages of Automated Builds 
• Early warning of broken code 
• Constant availability of a "current" build 
• Don’t continue developing on a broken foundation 
• Many more…. 
#sqlinthecity
Goals of today’s workshop 
1. Link a source control repository to a build system 
2. Use the SQLCI resources to implement build steps that: 
• Verify that your database code has built successfully 
• Verify an upgrade to an existing database 
• Run database unit tests 
3. Trigger builds automatically on changes being checked in to 
source control 
4. Introduce artifacts as the basis for future repeatable 
deployments 
#sqlinthecity
• Plugin for TeamCity 
• Part of the Red Gate SQL Automation Pack 
• Includes 3 build runners: 
• Build 
• Sync 
• Test 
#sqlinthecity 
SQLCI Plugin – What is it?
SQLCI 
#sqlinthecity
• Subversion(SVN) 
• SQL Server 2012 
• SQL Source Control 
• TeamCity 
#sqlinthecity 
Current setup
Creating a project 
• Creating a new TeamCity Project 
• Adding a VCS Root 
#sqlinthecity
The Build Step… 
#sqlinthecity 
CREATE 
TABLE 
foo… 
Does creation 
script run? 
? 
1. Convert scripts 
folder into 
package 
2. Generate the 
creation script 
3. Validate creation 
script
The Build Step… 
#sqlinthecity
Triggering… 
#sqlinthecity
Triggering… 
#sqlinthecity 
• Check it works so far.
Break time! 
#sqlinthecity
The Sync Step… 
#sqlinthecity 
1. Apply package version 
to target database 
2. Deployment 
validation 
(is the target the 
same as the 
package?) 
V1.1 
V1.2 
compare
The Sync Step… 
#sqlinthecity
The Sync Step… 
• Check it works so far. 
#sqlinthecity
Capturing an upgrade script… 
/scriptFile:“<FilePath>“ 
#sqlinthecity 
We can use %build.number% to grab the current build 
number.
Review… 
#sqlinthecity
Try it for yourself…. 
• SQLServerCentral 
#sqlinthecity
Lunch time! 
#sqlinthecity
The road to database CI 
1. Source control 
2. Automated builds 
3. Automated tests 
4. Frequent check ins of small changes 
#sqlinthecity 

The road to database CI 
1. Source control 
2. Automated builds 
3. Automated tests 
4. Frequent check ins of small changes 
#sqlinthecity
Advantages of Automated Tests 
• Early warning of broken code 
• Constant validation of existing functionality 
• Detect when new changes introduce errors 
• Feedback on the current state of the code 
• Many more…. 
#sqlinthecity
SQL Test – What is it? 
#sqlinthecity 
• Add-in for SQL Server Management Studio 
• Builds upon tSQLt framework 
• Adds a simple UI for creating, managing and running 
database unit tests. 
• All tests are written in T-SQL 
www.tsqlt.org
Add database to SQL Test 
#sqlinthecity
Add a test
Manually running the tests… 
• Check it works so far. 
#sqlinthecity
Automating tests 
#sqlinthecity
The Test Step… 
#sqlinthecity 
1. Build empty test 
database from 
package 
2. Populate a new 
database with test 
data (optional) 
3. Run tSQLt unit tests 
(report in JUnit 
format)
The Test Step… 
• Practical 
– sqlCI.exe Sync 
/package= <values5,2,3> 
/databaseServer=<value6> 
/databaseName=<value7> 
Optionally supply SQL Server Credentials 
#sqlinthecity
The Test Step… 
• Run the build 
#sqlinthecity
The Test Step… 
• Break the build 
#sqlinthecity
Review… 
#sqlinthecity
Break time! 
#sqlinthecity
Try it for yourself…. 
• SQLServerCentral 
#sqlinthecity 
– How about a test to check the name added by the 
sproc?
Contact info 
• Tom Austin 
– Pre Sales Engineer at Red Gate 
– Email: tom.austin@red-gate.com 
www.red-gate.com/ci 
#sqlinthecity

More Related Content

What's hot (18)

PPTX
FV04_MostoviczT_RAD
Tsvi Mostovicz
 
PPTX
Jenkins Pipeline 101 and TCI - presentation and workshop
Yoram Michaeli
 
PDF
Chicago alm user group tfs version control poster - tfvc and git
Dave Burnison
 
PPTX
Continuous Integration with Bamboo for Salesforce
Klea Kolaric
 
PPTX
Test automation proposal
Mihai-Cristian Fratila
 
PDF
Mozilla: Mozmill meets L10n
Henrik Skupin
 
PDF
Make sure your code works
Henrik Skupin
 
PPTX
Jenkins presentation
Valentin Buryakov
 
PDF
Graphql usage
Valentin Buryakov
 
PPTX
Effective .NET Core Unit Testing with SQLite and Dapper
Mike Melusky
 
ODP
Jenkins Pipelining and Gatling Integration
Knoldus Inc.
 
PDF
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
Ching-Hwa Yu
 
PPTX
Distribute your code with NUget and build vNext
Gian Maria Ricci
 
PDF
Crowd-sourced Automated Firefox UI Testing
Henrik Skupin
 
PPTX
Jenkins introduction
Gourav Varma
 
PPTX
CI with TFS
Esteban Garcia
 
PPTX
Deploy applications with TFS Build
Gian Maria Ricci
 
ODP
Testing JSF with Arquillian and Selenium
Lukáš Fryč
 
FV04_MostoviczT_RAD
Tsvi Mostovicz
 
Jenkins Pipeline 101 and TCI - presentation and workshop
Yoram Michaeli
 
Chicago alm user group tfs version control poster - tfvc and git
Dave Burnison
 
Continuous Integration with Bamboo for Salesforce
Klea Kolaric
 
Test automation proposal
Mihai-Cristian Fratila
 
Mozilla: Mozmill meets L10n
Henrik Skupin
 
Make sure your code works
Henrik Skupin
 
Jenkins presentation
Valentin Buryakov
 
Graphql usage
Valentin Buryakov
 
Effective .NET Core Unit Testing with SQLite and Dapper
Mike Melusky
 
Jenkins Pipelining and Gatling Integration
Knoldus Inc.
 
NIWeek 2017 - Automated Test of LabVIEW FPGA Code: CI and Jenkins 2 Pipelines
Ching-Hwa Yu
 
Distribute your code with NUget and build vNext
Gian Maria Ricci
 
Crowd-sourced Automated Firefox UI Testing
Henrik Skupin
 
Jenkins introduction
Gourav Varma
 
CI with TFS
Esteban Garcia
 
Deploy applications with TFS Build
Gian Maria Ricci
 
Testing JSF with Arquillian and Selenium
Lukáš Fryč
 

Similar to Part of the DLM Story: Automated database build and test with TeamCity (20)

PDF
Database Build and Release - SQL In The City - Ernest Hwang
Red Gate Software
 
PPT
Database continuous integration, unit test and functional test
Harry Zheng
 
PPT
Enter the Team City
Kashif Ali Siddiqui
 
PPTX
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Dr. John Tunnicliffe
 
PPTX
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Dr. John Tunnicliffe
 
PPTX
Best Practices for Database Deployments
Red Gate Software
 
PPTX
Sql source control
AndyPickett
 
PPTX
Getting CI right for SQL Server
Alex Yates
 
PPTX
11 Goals of High Functioning SQL Developers
Ike Ellis
 
PPTX
Continuous integration sql in the city
Ike Ellis
 
PDF
Continuous Integration in NET Marcin Kawalerowicz 2024 Scribd Download
shaynrojo
 
PDF
Case study: 13 Common Mistakes Organizations Make With DLM and How to Solve Them
Red Gate Software
 
PDF
Continuous Integration for Oracle Database Development
Vladimir Bakhov
 
PPTX
Get Testing with tSQLt - SQL In The City Workshop 2014
Red Gate Software
 
PPTX
Continuous integration with teamcity
Eugene Sheretov
 
PDF
Icygen
ICYGEN
 
PDF
Microsoft SQL Server Testing Frameworks
Mark Ginnebaugh
 
PPTX
#DOAW16 - DevOps@work Roma 2016 - Databases under source control
Alessandro Alpi
 
PDF
Continuous Integration in NET Marcin Kawalerowicz
senawoalklb
 
PDF
Continuous Integration in NET Marcin Kawalerowicz
sursefie
 
Database Build and Release - SQL In The City - Ernest Hwang
Red Gate Software
 
Database continuous integration, unit test and functional test
Harry Zheng
 
Enter the Team City
Kashif Ali Siddiqui
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Dr. John Tunnicliffe
 
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Dr. John Tunnicliffe
 
Best Practices for Database Deployments
Red Gate Software
 
Sql source control
AndyPickett
 
Getting CI right for SQL Server
Alex Yates
 
11 Goals of High Functioning SQL Developers
Ike Ellis
 
Continuous integration sql in the city
Ike Ellis
 
Continuous Integration in NET Marcin Kawalerowicz 2024 Scribd Download
shaynrojo
 
Case study: 13 Common Mistakes Organizations Make With DLM and How to Solve Them
Red Gate Software
 
Continuous Integration for Oracle Database Development
Vladimir Bakhov
 
Get Testing with tSQLt - SQL In The City Workshop 2014
Red Gate Software
 
Continuous integration with teamcity
Eugene Sheretov
 
Icygen
ICYGEN
 
Microsoft SQL Server Testing Frameworks
Mark Ginnebaugh
 
#DOAW16 - DevOps@work Roma 2016 - Databases under source control
Alessandro Alpi
 
Continuous Integration in NET Marcin Kawalerowicz
senawoalklb
 
Continuous Integration in NET Marcin Kawalerowicz
sursefie
 
Ad

More from Red Gate Software (20)

PDF
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
PDF
Embracing DevOps through database migrations with Flyway
Red Gate Software
 
PPTX
Database DevOps for Managed Service Providers
Red Gate Software
 
PDF
Mizuho Financial: Launching our Database DevOps journey
Red Gate Software
 
PDF
7 steps to effective SQL Server monitoring
Red Gate Software
 
PDF
Level up your deployments for SQL Source Control
Red Gate Software
 
PDF
Key findings from the 2020 state of database dev ops report
Red Gate Software
 
PPTX
Extend DevOps to Your SQL Server Databases
Red Gate Software
 
PDF
2019 year in review slides
Red Gate Software
 
PPTX
What we learned at PASS Summit in 2019
Red Gate Software
 
PPTX
Quality in Software Development: Anglia Ruskin University
Red Gate Software
 
PPTX
How SQL Change Automation helps you deliver value faster
Red Gate Software
 
PPTX
DevOps essentials from Abel Wang and Steve Jones
Red Gate Software
 
PPTX
Successfully migrating existing databases to Azure
Red Gate Software
 
PPTX
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
Red Gate Software
 
PDF
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Red Gate Software
 
PDF
Using Redgate, AKS and Azure to bring DevOps to your database
Red Gate Software
 
PDF
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
PDF
How to Pitch a Software Development Initiative and Ignite Culture Change
Red Gate Software
 
PDF
Taming the Wild West
Red Gate Software
 
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
Embracing DevOps through database migrations with Flyway
Red Gate Software
 
Database DevOps for Managed Service Providers
Red Gate Software
 
Mizuho Financial: Launching our Database DevOps journey
Red Gate Software
 
7 steps to effective SQL Server monitoring
Red Gate Software
 
Level up your deployments for SQL Source Control
Red Gate Software
 
Key findings from the 2020 state of database dev ops report
Red Gate Software
 
Extend DevOps to Your SQL Server Databases
Red Gate Software
 
2019 year in review slides
Red Gate Software
 
What we learned at PASS Summit in 2019
Red Gate Software
 
Quality in Software Development: Anglia Ruskin University
Red Gate Software
 
How SQL Change Automation helps you deliver value faster
Red Gate Software
 
DevOps essentials from Abel Wang and Steve Jones
Red Gate Software
 
Successfully migrating existing databases to Azure
Red Gate Software
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
Red Gate Software
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your database
Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Red Gate Software
 
How to Pitch a Software Development Initiative and Ignite Culture Change
Red Gate Software
 
Taming the Wild West
Red Gate Software
 
Ad

Recently uploaded (20)

PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Adobe Premiere Pro Crack / Full Version / Free Download
hashhshs786
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Add Background Images to Charts in IBM SPSS Statistics Version 31.pdf
Version 1 Analytics
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Adobe Premiere Pro Crack / Full Version / Free Download
hashhshs786
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
IObit Driver Booster Pro 12.4.0.585 Crack Free Download
henryc1122g
 

Part of the DLM Story: Automated database build and test with TeamCity

  • 1. #sqlinthecity Automated database build and test with TeamCity SITC Workshop Cambridge, UK
  • 2. What is CI? #sqlinthecity • Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
  • 3. What is database CI? • It’s the same! #sqlinthecity • Applying the same approach to the database as we do for the application
  • 4. The road to database CI 1. Source control 2. Automated builds 3. Automated tests 4. Frequent check ins of small changes #sqlinthecity 
  • 5. The road to database CI 1. Source control 2. Automated builds 3. Automated tests 4. Frequent check ins of small changes #sqlinthecity
  • 6. Advantages of Automated Builds • Early warning of broken code • Constant availability of a "current" build • Don’t continue developing on a broken foundation • Many more…. #sqlinthecity
  • 7. Goals of today’s workshop 1. Link a source control repository to a build system 2. Use the SQLCI resources to implement build steps that: • Verify that your database code has built successfully • Verify an upgrade to an existing database • Run database unit tests 3. Trigger builds automatically on changes being checked in to source control 4. Introduce artifacts as the basis for future repeatable deployments #sqlinthecity
  • 8. • Plugin for TeamCity • Part of the Red Gate SQL Automation Pack • Includes 3 build runners: • Build • Sync • Test #sqlinthecity SQLCI Plugin – What is it?
  • 10. • Subversion(SVN) • SQL Server 2012 • SQL Source Control • TeamCity #sqlinthecity Current setup
  • 11. Creating a project • Creating a new TeamCity Project • Adding a VCS Root #sqlinthecity
  • 12. The Build Step… #sqlinthecity CREATE TABLE foo… Does creation script run? ? 1. Convert scripts folder into package 2. Generate the creation script 3. Validate creation script
  • 13. The Build Step… #sqlinthecity
  • 15. Triggering… #sqlinthecity • Check it works so far.
  • 17. The Sync Step… #sqlinthecity 1. Apply package version to target database 2. Deployment validation (is the target the same as the package?) V1.1 V1.2 compare
  • 18. The Sync Step… #sqlinthecity
  • 19. The Sync Step… • Check it works so far. #sqlinthecity
  • 20. Capturing an upgrade script… /scriptFile:“<FilePath>“ #sqlinthecity We can use %build.number% to grab the current build number.
  • 22. Try it for yourself…. • SQLServerCentral #sqlinthecity
  • 24. The road to database CI 1. Source control 2. Automated builds 3. Automated tests 4. Frequent check ins of small changes #sqlinthecity 
  • 25. The road to database CI 1. Source control 2. Automated builds 3. Automated tests 4. Frequent check ins of small changes #sqlinthecity
  • 26. Advantages of Automated Tests • Early warning of broken code • Constant validation of existing functionality • Detect when new changes introduce errors • Feedback on the current state of the code • Many more…. #sqlinthecity
  • 27. SQL Test – What is it? #sqlinthecity • Add-in for SQL Server Management Studio • Builds upon tSQLt framework • Adds a simple UI for creating, managing and running database unit tests. • All tests are written in T-SQL www.tsqlt.org
  • 28. Add database to SQL Test #sqlinthecity
  • 30. Manually running the tests… • Check it works so far. #sqlinthecity
  • 32. The Test Step… #sqlinthecity 1. Build empty test database from package 2. Populate a new database with test data (optional) 3. Run tSQLt unit tests (report in JUnit format)
  • 33. The Test Step… • Practical – sqlCI.exe Sync /package= <values5,2,3> /databaseServer=<value6> /databaseName=<value7> Optionally supply SQL Server Credentials #sqlinthecity
  • 34. The Test Step… • Run the build #sqlinthecity
  • 35. The Test Step… • Break the build #sqlinthecity
  • 38. Try it for yourself…. • SQLServerCentral #sqlinthecity – How about a test to check the name added by the sproc?
  • 39. Contact info • Tom Austin – Pre Sales Engineer at Red Gate – Email: [email protected] www.red-gate.com/ci #sqlinthecity