Presentation is loading. Please wait.

Presentation is loading. Please wait.

SSDT and Database Project Basics

Similar presentations


Presentation on theme: "SSDT and Database Project Basics"— Presentation transcript:

1 SSDT and Database Project Basics
SQL Server Data Tools 2016 SSDT and Database Project Basics

2 Content Map Introduction Visual Studio Tooling Database Projects
Useful SSDT Tools Advanced Concepts

3 Introduction Steve Grier - Associate Architect with Computer Enterprise, Inc. (CEI) Microsoft P-Seller; Partner Technical Specialist 10+ years experience working with SQL Server 10+ years working as a .NET software developer 6 years working as a windows system administrator

4 SSDT Overview Manage Development Built on Visual Studio
SSAS Cubes & Tables SSRS Reports SSIS Packages Database Schema Built on Visual Studio Complete IDE Functionality

5 SSDT Project Types Analysis Services Projects Database Project
Integration Services Project Report Project

6 Fun Stuff First! DEMO Extract Modify Build Publish

7 Visual Studio Tooling

8 Visual Studio Development
Project and File based Approach Solution – Collection of Projects Project(s) – Collection of Files Folder(s) – Used for organization File(s) – Object definitions

9 Solutions Define Projects, Files, Build Configurations and Build Dependencies Plain Text formatting Created by default

10 Projects Collection of Source Code and Reference Files
Unit of Build and Deployment Defines organizational structure of Files Holds Build, Debug, Package and Deployment Configuration XML formatting Build – Checks Syntax; Checks Model Integrity; Packages everything for deployment

11 Database Projects

12 Database Project Collection of SQL objects
Builds a DACPAC for Deployment Deployment-time Script Support Refactor Support

13 Project Structure Default organization is: Schema\Object_Type\ObjectName Individual Files can be included/excluded from the Build Project properties Project references

14 Project Files Declarative Statements (Create not Alter) T-SQL Syntax
Content and Properties Content in File Properties in Project Best Practice One object per File

15 Project Properties Project and Database level settings
Target Platform (SQL Server version)

16 Database Settings sp_configure options Recovery options Collation
Compatibility Other Database- level settings/defaults

17 File Properties View from Properties Window (View-Properties Window [F4]) Bold properties stored in project file Build Actions Build – include as SQL object None – do not compile PreDeploy – run script before deployment PostDeploy – run script after deployment RefactorLog – list of rename actions

18 Useful SSDT Tools

19 Schema Compare SQL Compare
Examine the structure of source and target database definitions Can compare Database Projects, Dacpacs or SQL Server Databases Differences are listed with changes highlighted Targets can be updated directly from SQL Compare

20 Data Compare Data Compare
Examine the data in a source and target database Objects with matching table names and primary keys can be examined Targets can be updated to add/modify/remove records Foreign Keys are dropped/recreated during updates

21 Advanced Concepts

22 Pre and Post Deploy Scripts
One Pre Deploy and One Post Deploy script Reference other script files SQLCMD format Runs as part of the deployment process Built at Compile Time, not Deployment Time (target unspecific)

23 Pre and Post Deploy Patterns
Idempotent Scripts Check then Execute Echo actions using PRINT statements Create a migrations table to track migration scripts Avoid environment specific actions where possible

24 Database References Useful to split a database up into multiple sub-projects Allows inheriting sections of a database definition in multiple projects Use to enable cross-database querying in database project objects Avoid where possible because of added complexity

25 Source Control ! Must Use Licensed Version Of Visual Studio !
Version Changes to Projects and Files Branch and Merge to maintain concurrent development Keep a released branch for patch development and bug fixes Keep a development branch for new features Move/Sync changes between the two branches Manage and Prioritize changes with a Product Backlog Link object changes to Backlog Items and Tasks

26 Continuous Integration & Continuous Deployment
Automate build and release with tools like Visual Studio Team Services (VSTS) or Team Foundation Server (TFS) Constantly build and release changes to detect issues as soon as possible in the development projects Greatly increase consistency and deployment reliability

27 Questions?

28 Thank You! Steve Grier


Download ppt "SSDT and Database Project Basics"

Similar presentations


Ads by Google