Database Schema Management & Deployment using SQL Server Data Tools (SSDT)
The SSDT way or the highway
description
Transcript of The SSDT way or the highway
![Page 1: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/1.jpg)
The SSDT way or the highway(sqlproj)
Craig Ottley-ThistlethwaiteData Platform LeadData Science
![Page 2: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/2.jpg)
2©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 2©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Database Technologies
![Page 3: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/3.jpg)
3©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 3©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
This is what the highway can look like
![Page 4: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/4.jpg)
4©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 4©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 5: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/5.jpg)
5©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 5©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Project funded April 2005 (Data Dude) Project Started July 2005 VS 2005 Team System for Database Professionals VS 2008 Team System for Database Professionals Re-architected to be declarative model based system VS 2008 Team System for Database Professionals GDR R2 VS 2010 Team System for Database Professionals Transitioned to SQL Server 2009 SQL Server Data Tools
SQL Server Data Tools History
Source: http://sqlproj.com/wp-content/uploads/2012/03/SSDT-Workshop-2012-03-29-final.pdf
![Page 6: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/6.jpg)
6©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 6©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Evolution
.dbschema v1.1 VS 2008 GDR
.dbschema v1.2 VS 2010 dbproj
.sqlx v1.0SSDT CTP3
.dacpac v2.5SSDT CTP4
.dacpac v3.0 redist consumed by ALLSQL Products
.dacpac v1.0 SQL 2008 R2
RC
.dacpac v1.05SQL 2008 R2
RTM
.dacpac v1.1 SQL 2008 R2
SP1
.dacpac v2.0SQL 2012
RC0
Source: http://sqlproj.com/wp-content/uploads/2012/03/SSDT-Workshop-2012-03-29-final.pdf
![Page 7: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/7.jpg)
7©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 7©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Core SQL Server redistributable component which provides modelling, reverse engineering and deployment capabilities!
Managed Public API Command-Line tools (SqlPackage.exe) DACUnpack.exe
► Windows file handler for unpacking DACPACs to disk DACFx Clients
► SqlPackage.exe, SSMS, SSDT, SAMP, I&E, VS Web and DB Publishing
DAC Framework (DacFX)
DacFx does not support state/operational properties!
Source: http://sqlproj.com/wp-content/uploads/2012/03/SSDT-Workshop-2012-03-29-final.pdf
![Page 8: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/8.jpg)
8©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 8©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Declarative Schema Deployment
![Page 9: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/9.jpg)
9©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 9©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 10: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/10.jpg)
Inside the dacpac
![Page 11: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/11.jpg)
11©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 11©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 12: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/12.jpg)
Pre/Post Deployment Scripts
![Page 13: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/13.jpg)
13©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 13©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 14: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/14.jpg)
Check/Default Constraints
![Page 15: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/15.jpg)
15©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 15©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 16: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/16.jpg)
Add/Remove/Rename Columns
![Page 17: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/17.jpg)
17©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 17©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 18: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/18.jpg)
Column Data Type Conversions
![Page 19: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/19.jpg)
19©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 19©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 20: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/20.jpg)
20©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 20©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
DacFx Model API – What is it?
SSDT model’s a database’s schema, the API lets you access that model programmatically.
You can load, query and manipulate the schema to do what ever you like (within reason)
API model is loosely typed, the TSqlModel class contains loosely typed TSqlObject’s that represent all the elements in your schema
Each object will have some properties that describe it’s state and the relationships to other objects in the model
Use strongly typed classes to find the properties/relationships of an object using TsqlModel.GetObjects
private static void ReadTheModel(TSqlModel model) {
// This will get all tables. Note the use of Table.TypeClass!
var tables = model.GetObjects(DacQueryScopes.Default, Table.TypeClass).ToList();
}
API does not fully support everything an SSDT project supports! Feature Supported
Refactor Log Yes
Deployment Contributors Yes
Pre/Post Deployment Scripts No
References No
CLR Objects No
XML Schema Collections No
![Page 21: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/21.jpg)
21©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 21©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 22: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/22.jpg)
Deployment Contributor
![Page 23: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/23.jpg)
23©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 23©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Agenda
SQL Server Data Tools History
DAC Framework
Declarative Schema Deployment
Inside the dacpac
Pre/Post Deploy Scripts
Check/Default Constraints
Add/Remove/Rename Columns
Column Data Type Conversion
DacFx Public Model
Deploy Contributor
![Page 24: The SSDT way or the highway](https://reader030.fdocuments.net/reader030/viewer/2022033020/56815eda550346895dcd7756/html5/thumbnails/24.jpg)
24©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public. 24©2013 Experian Information Solutions, Inc. All rights reserved.Experian Public.
Resources
http://dacsamples.codeplex.com/ https://github.com/dacpac http://blogs.msdn.com/b/ssdt/archive/2013/12/23/dacfx-public-model-tutorial.aspx