SlideShare a Scribd company logo
1 of 32
Managing Database Project with Visual Studio, SSDT 
and TFS
About myself: 
• Seasoned data architect/DBA with 15 years of SQL Server experience 
• Independent consultant, currently Technical Delivery Manager at 
Government of Alberta 
• Microsoft Certified System Engineer: MCSE 
• Oracle Certified Professional: Oracle DBA 
• IBM Certified Solution Expert: DB2 UDB 
http://netdbsolutions.com 
https://twitter.com/HarryZheng 
http://ca.linkedin.com/in/harryzheng 
https://www.facebook.com/Harry.H.Zheng 
2
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
3
1.1 What is SSDT 
• Free download from MSDN 
• http://msdn.microsoft.com/en-US/data/tools.aspx 
4
1.2 Evolving of SSDT 
• Visual Studio 2005 DB Pro - Data Dude 
• Visual Studio Team System 2008 Database Edition 
• Visual Studio 2010 Database Project 
----------------------------------------------------------------- 
• SSDT 
• Visual Studio 2010 SSDT 
• Visual Studio 2012 SSDT 
Latest news: http://blogs.msdn.com/b/ssdt/ 
5
1.3 Visual Studio 2010 v.s. SSDT 2010 
Confusion on Visual Studio 2010 when selecting 
project template 
•Database Project templates – DB Pro style 
• Server Project 
• SQL 2005 
• SQL 2008 
•SSDT Database Project Template 
6
VS 2010 Database Project Templates 
7
SSDT Database Project Template 
8
1.4 Why SSDT 
• Manage database objects from Visual Studio – unified interface 
• Manage database version with source control tools, e.g. TFS 
• Refactoring 
• Schema Comparison 
• Database Unit Test 
9
1.5 SSDT Features 
• Solution Explorer 
• SQL Server Object Explorer – including Project Schema View 
• T-SQL Query Window 
• Online Connected Development 
• Offline Project Development – (localdb)Projects 
• Database Snapshot 
• Target switch to different SQL Server versions 
• Schema compare between: 
• Database 
• Database project 
• Project snapshot 
10
1.6 SSDT Limitations 
Not feature complete v.s. VS Database Professional (DBPro) 
•No data compare (this feature is available now) 
•No data generation (this feature is available now) 
Third party tool: 
•Red Gate Data Compare 
•Red Gate Data Generation 
11
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
12
2.1 Create a brand new database 
project 
• Add Member table from Solution Explorer 
• Update PK comumn to MemberID 
• Set Identity on MemberID 
• Add index IX_Member_BirthDate 
• Add Meeting table and MeetingAttendee table 
• Demo 
13
2.2 Import existing database into 
project 
1. Design Data Model in PowerDesigner 
2. Generate SQL Script from PowerDesigner 
3. Run SQL Script to local SQL Instance 
4. Import existing database to create the database project 
• Demo 
14
2.3 Create a project snapshot 
• Snapshot – point in time project objects 
Demo 
1 
5
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
16
3.1 Code Analysis 
• Add SP: uspShowMeetingAttendee with “select * from” 
• Build project 
• Project -> Property -> Code Analysis 
• Build project 
• Update Sp to select FirstName, LastName 
• Build project 
Demo 
17
3.2 Publish project 
• Publish to Integration 
• Publish to Windows Azure SQL Database 
Demo 
1 
8
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
19
4. Check in the project to Team 
Foundation Server (TFS) 
• Protect database schema objects 
• Track schema changes 
Demo 
• Check in database project 
20
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
21
5.1 Manage Table Change 
• Change Member.LastName to varchar 
• Checkin change 
• Inspect TFS history 
22
5.2 Refactor 
•Update table Member 
•Refactor Member.LastName to SurName 
•Inspect uspShowMeetingAttendee 
Demo 
23
5.3 Schema Compare 
Schema Compare 
•Compare Project to live Database 
•Update target database 
•Compare again 
•Schema compare options 
2 
4
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
25
6.1 Seed data with SQL Script 
• Add sql script to PostDeploymentScript 
• SSDT allows script data out 
Demo 
26
6.2 Seed data with BCP 
• BCP file in on PostDeploymentScript 
2 
7
6.3 Seed Data with Restore 
• Create a separate Seed Database to track seed data 
• Backup seed database to network share 
• Restore Seed database to target before deployment 
• Publish database to update target schema 
• Seed data remains 
2 
8
Session agenda 
1. Evolution of SSDT 
2. Create a database project with Visual Studio / SSDT 
3. Build and deploy database project 
4. Check in the project to Team Foundation Server (TFS) 
5. Manage database changes with SSDT and TFS 
6. Seed reference data and other test data for deployment 
7. Database Unit test and deployment packaging 
29
7.1 Database Change Work Flow 
1. Code Change 
2. Database build – code analysis 
3. Database deployment to locadb 
4. Data change deployment to localdb 
5. Database unit test against localdb 
6. Publish database to Testing env 
7. Publish database to Production 
3 
0
7.2 Database Unit Test 
1. Create a test project 
2. Add database test 
3. Build test project 
4. Switch to Test Explorer 
5. Run all tests 
6. Exam test results 
Demo 
3 
1
7.2 Database Deployment 
1. Schema Compare to generate schema change script 
2. Data Compare to generate data change script 
3. Script 1 + 2 = Deployment package 
3 
2

More Related Content

What's hot

Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's Newdpcobb
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersTobias Koprowski
 
Maximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 finalMaximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 finalVinh Nguyen
 
Introducing Microsoft SQL Server 2012
Introducing Microsoft SQL Server 2012Introducing Microsoft SQL Server 2012
Introducing Microsoft SQL Server 2012Intergen
 
SQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsSQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsJohn Martin
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsHostway|HOSTING
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your dataNeev Technologies
 
Advanced SQL Server Performance Tuning | IDERA
Advanced SQL Server Performance Tuning | IDERAAdvanced SQL Server Performance Tuning | IDERA
Advanced SQL Server Performance Tuning | IDERAIDERA Software
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverAntonios Chatzipavlis
 
Liquibase for java developers
Liquibase for java developersLiquibase for java developers
Liquibase for java developersIllia Seleznov
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACsqlserver.co.il
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012sqlserver.co.il
 
Microsoft SQL Server internals & architecture
Microsoft SQL Server internals & architectureMicrosoft SQL Server internals & architecture
Microsoft SQL Server internals & architectureKevin Kline
 
First Look to SSIS 2012
First Look to SSIS 2012First Look to SSIS 2012
First Look to SSIS 2012Pedro Perfeito
 
SQL Server 2019 Data Virtualization
SQL Server 2019 Data VirtualizationSQL Server 2019 Data Virtualization
SQL Server 2019 Data VirtualizationMatthew W. Bowers
 

What's hot (20)

Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
Maximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 finalMaximizing sql 2012 performance for share point 2013 final
Maximizing sql 2012 performance for share point 2013 final
 
Exploring sql server 2016 bi
Exploring sql server 2016 biExploring sql server 2016 bi
Exploring sql server 2016 bi
 
Introducing Microsoft SQL Server 2012
Introducing Microsoft SQL Server 2012Introducing Microsoft SQL Server 2012
Introducing Microsoft SQL Server 2012
 
SQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and EnhancementsSQL Server 2016 New Features and Enhancements
SQL Server 2016 New Features and Enhancements
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite Things
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
 
Advanced SQL Server Performance Tuning | IDERA
Advanced SQL Server Performance Tuning | IDERAAdvanced SQL Server Performance Tuning | IDERA
Advanced SQL Server Performance Tuning | IDERA
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql server
 
Liquibase for java developers
Liquibase for java developersLiquibase for java developers
Liquibase for java developers
 
Spark
SparkSpark
Spark
 
Stretch db sql server 2016 (sn0028)
Stretch db   sql server 2016 (sn0028)Stretch db   sql server 2016 (sn0028)
Stretch db sql server 2016 (sn0028)
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Microsoft SQL Server internals & architecture
Microsoft SQL Server internals & architectureMicrosoft SQL Server internals & architecture
Microsoft SQL Server internals & architecture
 
A to z for sql azure databases
A to z for sql azure databasesA to z for sql azure databases
A to z for sql azure databases
 
First Look to SSIS 2012
First Look to SSIS 2012First Look to SSIS 2012
First Look to SSIS 2012
 
Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013
 
SQL Server 2019 Data Virtualization
SQL Server 2019 Data VirtualizationSQL Server 2019 Data Virtualization
SQL Server 2019 Data Virtualization
 

Viewers also liked

Mtp ppt soumya_sarkar
Mtp ppt soumya_sarkarMtp ppt soumya_sarkar
Mtp ppt soumya_sarkarsamarai_apoc
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingAnna Russo
 
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEMA SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEMNexgen Technology
 
Graphical Based Authentication (S3PAS)
Graphical Based Authentication (S3PAS)Graphical Based Authentication (S3PAS)
Graphical Based Authentication (S3PAS)Ketan Patil
 
Graphical password
Graphical passwordGraphical password
Graphical passwordsowji888
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Ed Blankenship
 
Graphical password authentication system with association of sound
Graphical password authentication system with association of soundGraphical password authentication system with association of sound
Graphical password authentication system with association of soundVikram Verma
 
Graphical Password Authentication
Graphical Password AuthenticationGraphical Password Authentication
Graphical Password AuthenticationAbhijit Akotkar
 
Graphical password authentication
Graphical password authenticationGraphical password authentication
Graphical password authenticationshalini singh
 
Modern database management jeffrey a. hoffer, mary b. prescott,
Modern database management   jeffrey a. hoffer, mary b. prescott,  Modern database management   jeffrey a. hoffer, mary b. prescott,
Modern database management jeffrey a. hoffer, mary b. prescott, BlackIce86
 
Graphical password authentication
Graphical password authenticationGraphical password authentication
Graphical password authenticationAsim Kumar Pathak
 
Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Dinesh Jogdand
 
Project report on mobile shop management
Project report on mobile shop managementProject report on mobile shop management
Project report on mobile shop managementDinesh Jogdand
 
Ppt for graphical password authentication using cued click points
Ppt for graphical password authentication using cued click pointsPpt for graphical password authentication using cued click points
Ppt for graphical password authentication using cued click pointsHari Krishnan
 
INSURANCE DATABASE MANAGEMENT SYSTEM
INSURANCE DATABASE MANAGEMENT SYSTEMINSURANCE DATABASE MANAGEMENT SYSTEM
INSURANCE DATABASE MANAGEMENT SYSTEMsangeethavasan
 

Viewers also liked (18)

Mtp ppt soumya_sarkar
Mtp ppt soumya_sarkarMtp ppt soumya_sarkar
Mtp ppt soumya_sarkar
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
 
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEMA SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM
A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM
 
Graphical Based Authentication (S3PAS)
Graphical Based Authentication (S3PAS)Graphical Based Authentication (S3PAS)
Graphical Based Authentication (S3PAS)
 
Soloway.company.2
Soloway.company.2Soloway.company.2
Soloway.company.2
 
Graphical password
Graphical passwordGraphical password
Graphical password
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010
 
Graphical password authentication system with association of sound
Graphical password authentication system with association of soundGraphical password authentication system with association of sound
Graphical password authentication system with association of sound
 
Graphical Password Authentication
Graphical Password AuthenticationGraphical Password Authentication
Graphical Password Authentication
 
Graphical password authentication
Graphical password authenticationGraphical password authentication
Graphical password authentication
 
Modern database management jeffrey a. hoffer, mary b. prescott,
Modern database management   jeffrey a. hoffer, mary b. prescott,  Modern database management   jeffrey a. hoffer, mary b. prescott,
Modern database management jeffrey a. hoffer, mary b. prescott,
 
Graphical password authentication
Graphical password authenticationGraphical password authentication
Graphical password authentication
 
Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)Project report On MSM (Mobile Shop Management)
Project report On MSM (Mobile Shop Management)
 
Project report on mobile shop management
Project report on mobile shop managementProject report on mobile shop management
Project report on mobile shop management
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Ppt for graphical password authentication using cued click points
Ppt for graphical password authentication using cued click pointsPpt for graphical password authentication using cued click points
Ppt for graphical password authentication using cued click points
 
Payroll management
Payroll   managementPayroll   management
Payroll management
 
INSURANCE DATABASE MANAGEMENT SYSTEM
INSURANCE DATABASE MANAGEMENT SYSTEMINSURANCE DATABASE MANAGEMENT SYSTEM
INSURANCE DATABASE MANAGEMENT SYSTEM
 

Similar to Managing database project with Visual Studio SSDT and TFS

Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaDr. John Tunnicliffe
 
Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional testHarry Zheng
 
Microsoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview SlidesMicrosoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview SlidesMark Kromer
 
Database CI Demo Using Sql Server
Database CI  Demo Using Sql ServerDatabase CI  Demo Using Sql Server
Database CI Demo Using Sql ServerUmesh Kumar
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talkSplitgraph
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projectsfloydhilton
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDan Stine
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive�SSIS Monitoring Deep Dive�
SSIS Monitoring Deep DiveSolidQIT
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveDavide Mauri
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for DevelopersSarah Dutkiewicz
 
Migrating Data and Databases to Azure
Migrating Data and Databases to AzureMigrating Data and Databases to Azure
Migrating Data and Databases to AzureKaren Lopez
 
Meetup developing building and_deploying databases with SSDT
Meetup developing building and_deploying databases with SSDTMeetup developing building and_deploying databases with SSDT
Meetup developing building and_deploying databases with SSDTSolidify
 

Similar to Managing database project with Visual Studio SSDT and TFS (20)

Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday SloveniaContinuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
Continuous Integration and the Data Warehouse - PASS SQL Saturday Slovenia
 
Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional test
 
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
 
Microsoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview SlidesMicrosoft Azure Data Factory Hands-On Lab Overview Slides
Microsoft Azure Data Factory Hands-On Lab Overview Slides
 
Database CI Demo Using Sql Server
Database CI  Demo Using Sql ServerDatabase CI  Demo Using Sql Server
Database CI Demo Using Sql Server
 
Splitgraph: AHL talk
Splitgraph: AHL talkSplitgraph: AHL talk
Splitgraph: AHL talk
 
SQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database ProjectsSQL in Version Control using SQL Server Database Projects
SQL in Version Control using SQL Server Database Projects
 
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive�SSIS Monitoring Deep Dive�
SSIS Monitoring Deep Dive
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for Developers
 
Migrating Data and Databases to Azure
Migrating Data and Databases to AzureMigrating Data and Databases to Azure
Migrating Data and Databases to Azure
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
Ow
OwOw
Ow
 
Meetup developing building and_deploying databases with SSDT
Meetup developing building and_deploying databases with SSDTMeetup developing building and_deploying databases with SSDT
Meetup developing building and_deploying databases with SSDT
 

Recently uploaded

Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Managing database project with Visual Studio SSDT and TFS

  • 1. Managing Database Project with Visual Studio, SSDT and TFS
  • 2. About myself: • Seasoned data architect/DBA with 15 years of SQL Server experience • Independent consultant, currently Technical Delivery Manager at Government of Alberta • Microsoft Certified System Engineer: MCSE • Oracle Certified Professional: Oracle DBA • IBM Certified Solution Expert: DB2 UDB http://netdbsolutions.com https://twitter.com/HarryZheng http://ca.linkedin.com/in/harryzheng https://www.facebook.com/Harry.H.Zheng 2
  • 3. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 3
  • 4. 1.1 What is SSDT • Free download from MSDN • http://msdn.microsoft.com/en-US/data/tools.aspx 4
  • 5. 1.2 Evolving of SSDT • Visual Studio 2005 DB Pro - Data Dude • Visual Studio Team System 2008 Database Edition • Visual Studio 2010 Database Project ----------------------------------------------------------------- • SSDT • Visual Studio 2010 SSDT • Visual Studio 2012 SSDT Latest news: http://blogs.msdn.com/b/ssdt/ 5
  • 6. 1.3 Visual Studio 2010 v.s. SSDT 2010 Confusion on Visual Studio 2010 when selecting project template •Database Project templates – DB Pro style • Server Project • SQL 2005 • SQL 2008 •SSDT Database Project Template 6
  • 7. VS 2010 Database Project Templates 7
  • 9. 1.4 Why SSDT • Manage database objects from Visual Studio – unified interface • Manage database version with source control tools, e.g. TFS • Refactoring • Schema Comparison • Database Unit Test 9
  • 10. 1.5 SSDT Features • Solution Explorer • SQL Server Object Explorer – including Project Schema View • T-SQL Query Window • Online Connected Development • Offline Project Development – (localdb)Projects • Database Snapshot • Target switch to different SQL Server versions • Schema compare between: • Database • Database project • Project snapshot 10
  • 11. 1.6 SSDT Limitations Not feature complete v.s. VS Database Professional (DBPro) •No data compare (this feature is available now) •No data generation (this feature is available now) Third party tool: •Red Gate Data Compare •Red Gate Data Generation 11
  • 12. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 12
  • 13. 2.1 Create a brand new database project • Add Member table from Solution Explorer • Update PK comumn to MemberID • Set Identity on MemberID • Add index IX_Member_BirthDate • Add Meeting table and MeetingAttendee table • Demo 13
  • 14. 2.2 Import existing database into project 1. Design Data Model in PowerDesigner 2. Generate SQL Script from PowerDesigner 3. Run SQL Script to local SQL Instance 4. Import existing database to create the database project • Demo 14
  • 15. 2.3 Create a project snapshot • Snapshot – point in time project objects Demo 1 5
  • 16. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 16
  • 17. 3.1 Code Analysis • Add SP: uspShowMeetingAttendee with “select * from” • Build project • Project -> Property -> Code Analysis • Build project • Update Sp to select FirstName, LastName • Build project Demo 17
  • 18. 3.2 Publish project • Publish to Integration • Publish to Windows Azure SQL Database Demo 1 8
  • 19. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 19
  • 20. 4. Check in the project to Team Foundation Server (TFS) • Protect database schema objects • Track schema changes Demo • Check in database project 20
  • 21. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 21
  • 22. 5.1 Manage Table Change • Change Member.LastName to varchar • Checkin change • Inspect TFS history 22
  • 23. 5.2 Refactor •Update table Member •Refactor Member.LastName to SurName •Inspect uspShowMeetingAttendee Demo 23
  • 24. 5.3 Schema Compare Schema Compare •Compare Project to live Database •Update target database •Compare again •Schema compare options 2 4
  • 25. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 25
  • 26. 6.1 Seed data with SQL Script • Add sql script to PostDeploymentScript • SSDT allows script data out Demo 26
  • 27. 6.2 Seed data with BCP • BCP file in on PostDeploymentScript 2 7
  • 28. 6.3 Seed Data with Restore • Create a separate Seed Database to track seed data • Backup seed database to network share • Restore Seed database to target before deployment • Publish database to update target schema • Seed data remains 2 8
  • 29. Session agenda 1. Evolution of SSDT 2. Create a database project with Visual Studio / SSDT 3. Build and deploy database project 4. Check in the project to Team Foundation Server (TFS) 5. Manage database changes with SSDT and TFS 6. Seed reference data and other test data for deployment 7. Database Unit test and deployment packaging 29
  • 30. 7.1 Database Change Work Flow 1. Code Change 2. Database build – code analysis 3. Database deployment to locadb 4. Data change deployment to localdb 5. Database unit test against localdb 6. Publish database to Testing env 7. Publish database to Production 3 0
  • 31. 7.2 Database Unit Test 1. Create a test project 2. Add database test 3. Build test project 4. Switch to Test Explorer 5. Run all tests 6. Exam test results Demo 3 1
  • 32. 7.2 Database Deployment 1. Schema Compare to generate schema change script 2. Data Compare to generate data change script 3. Script 1 + 2 = Deployment package 3 2