SlideShare a Scribd company logo
@NowinskiK
SQLSat Kyiv Team
Eugene Polonichko
Mykola Pobyivovk
Yevhen Nedashkivskyi
Oksana Tkach
Oksana Borysenko
Denis Reznik
Anton Artomov
@NowinskiK
Sponsors
@NowinskiK
Session will begin very soon :)
Please complete the electronic evaluation form for this
session and for the event. Your feedback will help us to
improve future conferences and speakers will appreciate
your feedback!
Enjoy the conference!
Kamil Nowiński
@SQLPlayer
The databases in SSDT
A work with project and best practices
Kamil Nowiński
Microsoft Data Platform MVP
Speaker, blogger, data enthusiast
Senior Data Engineer at ASOS (www.asos.com)
15+ yrs experience as DEV/BI/(DBA)
Member of the Data Community PL
Project member of „SCD Merge Wizard”
Founder of blog SQLPlayer (www.SQLplayer.net)
SQL Server Certificates:
MCITP, MCP, MCTS, MCSA, MCSE Data Platform,
MCSE Data Management & Analytics
Moreover: Bicycle, Running, Digital photography
@NowinskiK, @SQLPlayer
Blog & interviews
www.SQLPlayer.net
@NowinskiK
PODCAST – interviews with...
@NowinskiK
DevOps – definition (Wikipedia)
DevOps (a clipped compound of "development" and "operations") is a
software engineering culture and practice that aims at unifying software
development (Dev) and software operation (Ops).
The main characteristic of the DevOps movement is to strongly advocate
automation and monitoring at all steps of software construction, from
integration, testing, releasing to deployment and infrastructure management.
DevOps aims at shorter development cycles, increased deployment
frequency, and more dependable releases, in close alignment with business
objectives.
@NowinskiK
DevOps approach across your project
• Already adopted across SOME projects
• Already adopted across ALL projects
• Plan to adopt in the next 2 years
• Not adopted and no plans in the next 2 years
@NowinskiK
Redgate – State of database DevOps
@NowinskiK
AGENDA
• What is the SSDT?
• Do I need it?
• How to start with DACPAC’s?
• (Well) known issues
• Deploy/Publish database to target server
• Circular dependencies!
@NowinskiK
What is the SSDT?
• SQL Server Data Tools
• Now, it’s a part of Visual Studio
• Free!
• Database project, including:
• Schema, Stored Procedures, Functions,
• Tables, Views, Security, CLR
• ... and much more!
@NowinskiK
SSDT: How to install?
@NowinskiK
SSDT: How to download, install?
@NowinskiK
DACPAC, BACPAC
• DACPAC = Data Tier AppliCation PACkage
– Doesn’t contain DATA
– Contains SCHEMA Only
• BACPAC = BACkup PACage
– Contains SCHEMA
– Contains DATA (BCP native format)
• ZIP format
@NowinskiK
How to start with database project?
• Install SSDT
• Create new db project and import:
• From script
• Directly from SQL server
• Data-Tier Application (DACPAC)
@NowinskiK
(Well) known issues
@NowinskiK
(Well) known issues
• Same database references
• Circular references/dependencies
• Unvisible temp tables
• Disable/Enable trigger across databases
• How to manage of data?
• Can I deploy SQL Jobs?
@NowinskiK
Database dependencies & references
Tables:
• Customer
• InvoiceHeader
• InvoiceLines
• CustomerAddress
• CustomerEmail
Triggers:
• Tr_Customer
• Tr_CustomerEmail
Stored Procedures:
• AddLogItem
CRMCRM_Audit
Tables:
• Customer_Audit
• CustomerAddress_Audit
• CustomerEmail_Audit
• TransactionLog

@NowinskiK
Circular dependencies
CRMCRM_Interface
Stored Procedures:
• GetCustomerDetails
• MergeCustomers
• AddLogItem
• GetCustomerInvoice
Tables:
• Customer_Audit
• CustomerAddress_Audit
• CustomerEmail_Audit
• TransactionLog
Tables:
• Customer
• InvoiceHeader
• InvoiceLines
• CustomerAddress
• CustomerEmail
Triggers:
• Tr_Customer
• Tr_CustomerEmail
Stored Procedures:
• AddLogItem
@NowinskiK
Circular dependencies
CRMCRM_Interface
@NowinskiK
Circular dependencies
CRM
CRM_Interface
CRM_Interface.CRM
Hey, I’m
the same
database!
@NowinskiK
DEMO
• Create empty database project
• Import database from server
• Create references & variables
• Resolve first issues
• Resolve circular references
@NowinskiK
Circular dependencies
CRM_Interface
CRM_Audit
Campaigns
Rewards
Reports
CRM
@NowinskiK
Circular dependencies
@NowinskiK
Know issue: temp table
CREATE PROCEDURE [dbo].[TempDemo1]
AS
CREATE TABLE #TempTable (Id INT);
EXEC TempDemo2;
CREATE PROCEDURE [dbo].[TempDemo2]
AS
SELECT * FROM #TempTable;
RETURN 0
SSDT says:
I don’t know that
table!
@NowinskiK
Know issue: temp table
CREATE PROCEDURE [dbo].[TempDemo1]
AS
CREATE TABLE #TempTable (Id INT);
EXEC TempDemo2;
CREATE PROCEDURE [dbo].[TempDemo2]
AS
IF 0=1
CREATE TABLE #TempTable (ID int);
SELECT * FROM #TempTable;
RETURN 0
@NowinskiK
Know issue: Disable/Enable trigger #1
• Disable/Enable trigger from other database
ALTER TABLE [$(ContosoRetailDW)].dbo.DimChannel
DISABLE TRIGGER [Trigger_DimChannel];
@NowinskiK
Know issue: Disable/Enable trigger #2
• Alternative #1:
• Use dynamic SQL (not recommended)
@NowinskiK
Know issue: Disable/Enable trigger #3
• Alternative #2:
• Create SP in the second database (locally for the trigger)
• Call that SP from ’Remote’ database
@NowinskiK
How to include data in a database project?
• SSDT has no built-in solution for including data
• Use Post-Deployment script to populate table
• Wrap the scripts into stored procedures
• Make sure the order of referenced tables
@NowinskiK
How to include data in a database project?
• Scenario #1: initial values only
• For the very first time (run) only
• Target table is empty
• INSERT
• Example script
@NowinskiK
How to include data in a database project?
• Scenario #2: User has NO access to data
• Full MERGE statement
• Include DELETE clause
• Example script
@NowinskiK
How to include data in a database project?
• Scenario #3: users CAN add values from app
• MERGE statement
• Exclude DELETE clause
• Example script
@NowinskiK
DEMO
• Create publish profile
• Deploy manually
• Data script in Stored Procedure
• Post-Deployment script
• How to change data & deploy it
@NowinskiK
SQL Jobs in database project
• Facts:
• DACPAC is a database level project
• SQLJobs are on server-level
• How to cope with:
• Add separate database project
• Only T-SQL scripts
• Pre/Post deployment script to include above
• Use PowerShell and SALT module from Sabin.io
@NowinskiK
Resources
• SQL Server Data Tools (MSDN)
• SQLPackage.exe (MSDN)
• Data-tier Application Framework (DACFx)
• Microsoft SQL Server Data Tools Team Blog
• GIT – branch organization
• Continuous Delivery and the Database (Redgate)
• Alex Yates - model vs mig
• Version Control tools for SQL Server
• SQLPlayer.net blog
@NowinskiK
Questions?
Thank you!
Kamil Nowinski
Microsoft Data Platform MVP
MCSE Data Platform & MCSE Data Management and Analytics
kamil@nowinski.net
@NowinskiK @SQLPlayer
SQLPlayer.net
https://github.com/NowinskiK/CommunityEvents

More Related Content

What's hot

SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2
Davide Mauri
 
Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
Kevin Kline
 
Reduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceReduce latency and boost sql server io performance
Reduce latency and boost sql server io performance
Kevin Kline
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounder
Markus Winand
 
Azure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applicationsAzure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applications
Davide Mauri
 
Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...
Andy Kucharski
 
Schema less table & dynamic schema
Schema less table & dynamic schemaSchema less table & dynamic schema
Schema less table & dynamic schema
Davide Mauri
 
Wakanda db parisjs-2011-12
Wakanda db parisjs-2011-12Wakanda db parisjs-2011-12
Wakanda db parisjs-2011-12
Thibaud Arguillere
 
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
Antonios Chatzipavlis
 
50 Shades of Fail KScope16
50 Shades of Fail KScope1650 Shades of Fail KScope16
50 Shades of Fail KScope16
Christian Berg
 
Web Data Analysis at the Spallation Neutron Source
Web Data Analysis at the Spallation Neutron SourceWeb Data Analysis at the Spallation Neutron Source
Web Data Analysis at the Spallation Neutron Source
Ricardo Ferraz Leal
 
SQL vs. NoSQL. It's always a hard choice.
SQL vs. NoSQL. It's always a hard choice.SQL vs. NoSQL. It's always a hard choice.
SQL vs. NoSQL. It's always a hard choice.
Denis Reznik
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
Anita Luthra
 
SDL Trados Studio 2014... what's new?
SDL Trados Studio 2014... what's new?SDL Trados Studio 2014... what's new?
SDL Trados Studio 2014... what's new?
SDL Trados
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?
IDERA Software
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
Ike Ellis
 
Tableau API
Tableau APITableau API
Tableau API
Dmitry Anoshin
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
Davide Mauri
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
Ike Ellis
 
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
NoSQLmatters
 

What's hot (20)

SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2SQL Server & SQL Azure Temporal Tables - V2
SQL Server & SQL Azure Temporal Tables - V2
 
Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
 
Reduce latency and boost sql server io performance
Reduce latency and boost sql server io performanceReduce latency and boost sql server io performance
Reduce latency and boost sql server io performance
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounder
 
Azure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applicationsAzure ML: from basic to integration with custom applications
Azure ML: from basic to integration with custom applications
 
Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...
 
Schema less table & dynamic schema
Schema less table & dynamic schemaSchema less table & dynamic schema
Schema less table & dynamic schema
 
Wakanda db parisjs-2011-12
Wakanda db parisjs-2011-12Wakanda db parisjs-2011-12
Wakanda db parisjs-2011-12
 
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
 
50 Shades of Fail KScope16
50 Shades of Fail KScope1650 Shades of Fail KScope16
50 Shades of Fail KScope16
 
Web Data Analysis at the Spallation Neutron Source
Web Data Analysis at the Spallation Neutron SourceWeb Data Analysis at the Spallation Neutron Source
Web Data Analysis at the Spallation Neutron Source
 
SQL vs. NoSQL. It's always a hard choice.
SQL vs. NoSQL. It's always a hard choice.SQL vs. NoSQL. It's always a hard choice.
SQL vs. NoSQL. It's always a hard choice.
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
 
SDL Trados Studio 2014... what's new?
SDL Trados Studio 2014... what's new?SDL Trados Studio 2014... what's new?
SDL Trados Studio 2014... what's new?
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?Geek Sync | Extended Events: What Are They and How Do I Use Them?
Geek Sync | Extended Events: What Are They and How Do I Use Them?
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
Tableau API
Tableau APITableau API
Tableau API
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
Sebastian Cohnen – Building a Startup with NoSQL - NoSQL matters Barcelona 2014
 

Similar to The databases in SSDT: A work with project and best practices

Migrating Data and Databases to Azure
Migrating Data and Databases to AzureMigrating Data and Databases to Azure
Migrating Data and Databases to Azure
Karen Lopez
 
Data Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCData Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDC
Abhijit Kumar
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
Marek Maśko
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
Brant Burnett
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
Mike Broberg
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Eric Bragas
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
Derek Jacoby
 
SQL Server PowerShell - Community Tools
SQL Server PowerShell - Community ToolsSQL Server PowerShell - Community Tools
SQL Server PowerShell - Community Tools
Lars Platzdasch
 
Exploring sql server 2016
Exploring sql server 2016Exploring sql server 2016
Exploring sql server 2016
Antonios Chatzipavlis
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
Michaela Murray
 
Powering a Startup with Apache Spark with Kevin Kim
Powering a Startup with Apache Spark with Kevin KimPowering a Startup with Apache Spark with Kevin Kim
Powering a Startup with Apache Spark with Kevin Kim
Spark Summit
 
Visual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) OverviewVisual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) Overview
Steve Lange
 
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca SartoriCCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
walk2talk srl
 
Building a Turbo-fast Data Warehousing Platform with Databricks
Building a Turbo-fast Data Warehousing Platform with DatabricksBuilding a Turbo-fast Data Warehousing Platform with Databricks
Building a Turbo-fast Data Warehousing Platform with Databricks
Databricks
 
Azure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data FlowsAzure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data Flows
Thomas Sykes
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
DAGEOP LTD
 
Moving advanced analytics to your sql server databases
Moving advanced analytics to your sql server databasesMoving advanced analytics to your sql server databases
Moving advanced analytics to your sql server databases
Enrico van de Laar
 
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriarAdf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Nilesh Shah
 

Similar to The databases in SSDT: A work with project and best practices (20)

Migrating Data and Databases to Azure
Migrating Data and Databases to AzureMigrating Data and Databases to Azure
Migrating Data and Databases to Azure
 
Data Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCData Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDC
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
 
NoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using CouchbaseNoSQL for SQL Server Developers using Couchbase
NoSQL for SQL Server Developers using Couchbase
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL DatabaseModern ETL: Azure Data Factory, Data Lake, and SQL Database
Modern ETL: Azure Data Factory, Data Lake, and SQL Database
 
Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
SQL Server PowerShell - Community Tools
SQL Server PowerShell - Community ToolsSQL Server PowerShell - Community Tools
SQL Server PowerShell - Community Tools
 
Exploring sql server 2016
Exploring sql server 2016Exploring sql server 2016
Exploring sql server 2016
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
Powering a Startup with Apache Spark with Kevin Kim
Powering a Startup with Apache Spark with Kevin KimPowering a Startup with Apache Spark with Kevin Kim
Powering a Startup with Apache Spark with Kevin Kim
 
Visual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) OverviewVisual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) Overview
 
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca SartoriCCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
CCI2017 - Considerations for Migrating Databases to Azure - Gianluca Sartori
 
Building a Turbo-fast Data Warehousing Platform with Databricks
Building a Turbo-fast Data Warehousing Platform with DatabricksBuilding a Turbo-fast Data Warehousing Platform with Databricks
Building a Turbo-fast Data Warehousing Platform with Databricks
 
Azure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data FlowsAzure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data Flows
 
David Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to EspressoDavid Max SATURN 2018 - Migrating from Oracle to Espresso
David Max SATURN 2018 - Migrating from Oracle to Espresso
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 
Moving advanced analytics to your sql server databases
Moving advanced analytics to your sql server databasesMoving advanced analytics to your sql server databases
Moving advanced analytics to your sql server databases
 
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriarAdf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
Adf and ala design c sharp corner toronto chapter feb 2019 meetup nik shahriar
 

More from Kamil Nowinski

Nowości w zakresie bezpieczeństwa w SQL Server 2016
Nowości w zakresie bezpieczeństwa w SQL Server 2016Nowości w zakresie bezpieczeństwa w SQL Server 2016
Nowości w zakresie bezpieczeństwa w SQL Server 2016
Kamil Nowinski
 
Sql day2015 fts
Sql day2015 ftsSql day2015 fts
Sql day2015 fts
Kamil Nowinski
 
Wyszukiwanie pełnotekstowe w SQL Server
Wyszukiwanie pełnotekstowe w SQL ServerWyszukiwanie pełnotekstowe w SQL Server
Wyszukiwanie pełnotekstowe w SQL Server
Kamil Nowinski
 
Wprowadzenie do modelowania danych w PowerPivot
Wprowadzenie do modelowania danych w PowerPivotWprowadzenie do modelowania danych w PowerPivot
Wprowadzenie do modelowania danych w PowerPivot
Kamil Nowinski
 
Zasilanie hurtowni danych w SSIS w praktyce
Zasilanie hurtowni danych w SSIS w praktyceZasilanie hurtowni danych w SSIS w praktyce
Zasilanie hurtowni danych w SSIS w praktyce
Kamil Nowinski
 
SQLDay 2014 - Change Tracking & Change Data Capture
SQLDay 2014 - Change Tracking & Change Data CaptureSQLDay 2014 - Change Tracking & Change Data Capture
SQLDay 2014 - Change Tracking & Change Data CaptureKamil Nowinski
 

More from Kamil Nowinski (7)

Nowości w zakresie bezpieczeństwa w SQL Server 2016
Nowości w zakresie bezpieczeństwa w SQL Server 2016Nowości w zakresie bezpieczeństwa w SQL Server 2016
Nowości w zakresie bezpieczeństwa w SQL Server 2016
 
Sql day2015 fts
Sql day2015 ftsSql day2015 fts
Sql day2015 fts
 
Wyszukiwanie pełnotekstowe w SQL Server
Wyszukiwanie pełnotekstowe w SQL ServerWyszukiwanie pełnotekstowe w SQL Server
Wyszukiwanie pełnotekstowe w SQL Server
 
Wprowadzenie do modelowania danych w PowerPivot
Wprowadzenie do modelowania danych w PowerPivotWprowadzenie do modelowania danych w PowerPivot
Wprowadzenie do modelowania danych w PowerPivot
 
Zasilanie hurtowni danych w SSIS w praktyce
Zasilanie hurtowni danych w SSIS w praktyceZasilanie hurtowni danych w SSIS w praktyce
Zasilanie hurtowni danych w SSIS w praktyce
 
SQLDay 2014 - Change Tracking & Change Data Capture
SQLDay 2014 - Change Tracking & Change Data CaptureSQLDay 2014 - Change Tracking & Change Data Capture
SQLDay 2014 - Change Tracking & Change Data Capture
 
Change Tracking
Change TrackingChange Tracking
Change Tracking
 

Recently uploaded

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

The databases in SSDT: A work with project and best practices

  • 1. @NowinskiK SQLSat Kyiv Team Eugene Polonichko Mykola Pobyivovk Yevhen Nedashkivskyi Oksana Tkach Oksana Borysenko Denis Reznik Anton Artomov
  • 3. @NowinskiK Session will begin very soon :) Please complete the electronic evaluation form for this session and for the event. Your feedback will help us to improve future conferences and speakers will appreciate your feedback! Enjoy the conference!
  • 4. Kamil Nowiński @SQLPlayer The databases in SSDT A work with project and best practices
  • 5. Kamil Nowiński Microsoft Data Platform MVP Speaker, blogger, data enthusiast Senior Data Engineer at ASOS (www.asos.com) 15+ yrs experience as DEV/BI/(DBA) Member of the Data Community PL Project member of „SCD Merge Wizard” Founder of blog SQLPlayer (www.SQLplayer.net) SQL Server Certificates: MCITP, MCP, MCTS, MCSA, MCSE Data Platform, MCSE Data Management & Analytics Moreover: Bicycle, Running, Digital photography @NowinskiK, @SQLPlayer
  • 8. @NowinskiK DevOps – definition (Wikipedia) DevOps (a clipped compound of "development" and "operations") is a software engineering culture and practice that aims at unifying software development (Dev) and software operation (Ops). The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, and more dependable releases, in close alignment with business objectives.
  • 9. @NowinskiK DevOps approach across your project • Already adopted across SOME projects • Already adopted across ALL projects • Plan to adopt in the next 2 years • Not adopted and no plans in the next 2 years
  • 10. @NowinskiK Redgate – State of database DevOps
  • 11. @NowinskiK AGENDA • What is the SSDT? • Do I need it? • How to start with DACPAC’s? • (Well) known issues • Deploy/Publish database to target server • Circular dependencies!
  • 12. @NowinskiK What is the SSDT? • SQL Server Data Tools • Now, it’s a part of Visual Studio • Free! • Database project, including: • Schema, Stored Procedures, Functions, • Tables, Views, Security, CLR • ... and much more!
  • 14. @NowinskiK SSDT: How to download, install?
  • 15. @NowinskiK DACPAC, BACPAC • DACPAC = Data Tier AppliCation PACkage – Doesn’t contain DATA – Contains SCHEMA Only • BACPAC = BACkup PACage – Contains SCHEMA – Contains DATA (BCP native format) • ZIP format
  • 16. @NowinskiK How to start with database project? • Install SSDT • Create new db project and import: • From script • Directly from SQL server • Data-Tier Application (DACPAC)
  • 18. @NowinskiK (Well) known issues • Same database references • Circular references/dependencies • Unvisible temp tables • Disable/Enable trigger across databases • How to manage of data? • Can I deploy SQL Jobs?
  • 19. @NowinskiK Database dependencies & references Tables: • Customer • InvoiceHeader • InvoiceLines • CustomerAddress • CustomerEmail Triggers: • Tr_Customer • Tr_CustomerEmail Stored Procedures: • AddLogItem CRMCRM_Audit Tables: • Customer_Audit • CustomerAddress_Audit • CustomerEmail_Audit • TransactionLog 
  • 20. @NowinskiK Circular dependencies CRMCRM_Interface Stored Procedures: • GetCustomerDetails • MergeCustomers • AddLogItem • GetCustomerInvoice Tables: • Customer_Audit • CustomerAddress_Audit • CustomerEmail_Audit • TransactionLog Tables: • Customer • InvoiceHeader • InvoiceLines • CustomerAddress • CustomerEmail Triggers: • Tr_Customer • Tr_CustomerEmail Stored Procedures: • AddLogItem
  • 23. @NowinskiK DEMO • Create empty database project • Import database from server • Create references & variables • Resolve first issues • Resolve circular references
  • 26. @NowinskiK Know issue: temp table CREATE PROCEDURE [dbo].[TempDemo1] AS CREATE TABLE #TempTable (Id INT); EXEC TempDemo2; CREATE PROCEDURE [dbo].[TempDemo2] AS SELECT * FROM #TempTable; RETURN 0 SSDT says: I don’t know that table!
  • 27. @NowinskiK Know issue: temp table CREATE PROCEDURE [dbo].[TempDemo1] AS CREATE TABLE #TempTable (Id INT); EXEC TempDemo2; CREATE PROCEDURE [dbo].[TempDemo2] AS IF 0=1 CREATE TABLE #TempTable (ID int); SELECT * FROM #TempTable; RETURN 0
  • 28. @NowinskiK Know issue: Disable/Enable trigger #1 • Disable/Enable trigger from other database ALTER TABLE [$(ContosoRetailDW)].dbo.DimChannel DISABLE TRIGGER [Trigger_DimChannel];
  • 29. @NowinskiK Know issue: Disable/Enable trigger #2 • Alternative #1: • Use dynamic SQL (not recommended)
  • 30. @NowinskiK Know issue: Disable/Enable trigger #3 • Alternative #2: • Create SP in the second database (locally for the trigger) • Call that SP from ’Remote’ database
  • 31. @NowinskiK How to include data in a database project? • SSDT has no built-in solution for including data • Use Post-Deployment script to populate table • Wrap the scripts into stored procedures • Make sure the order of referenced tables
  • 32. @NowinskiK How to include data in a database project? • Scenario #1: initial values only • For the very first time (run) only • Target table is empty • INSERT • Example script
  • 33. @NowinskiK How to include data in a database project? • Scenario #2: User has NO access to data • Full MERGE statement • Include DELETE clause • Example script
  • 34. @NowinskiK How to include data in a database project? • Scenario #3: users CAN add values from app • MERGE statement • Exclude DELETE clause • Example script
  • 35. @NowinskiK DEMO • Create publish profile • Deploy manually • Data script in Stored Procedure • Post-Deployment script • How to change data & deploy it
  • 36. @NowinskiK SQL Jobs in database project • Facts: • DACPAC is a database level project • SQLJobs are on server-level • How to cope with: • Add separate database project • Only T-SQL scripts • Pre/Post deployment script to include above • Use PowerShell and SALT module from Sabin.io
  • 37. @NowinskiK Resources • SQL Server Data Tools (MSDN) • SQLPackage.exe (MSDN) • Data-tier Application Framework (DACFx) • Microsoft SQL Server Data Tools Team Blog • GIT – branch organization • Continuous Delivery and the Database (Redgate) • Alex Yates - model vs mig • Version Control tools for SQL Server • SQLPlayer.net blog
  • 39. Thank you! Kamil Nowinski Microsoft Data Platform MVP MCSE Data Platform & MCSE Data Management and Analytics kamil@nowinski.net @NowinskiK @SQLPlayer SQLPlayer.net https://github.com/NowinskiK/CommunityEvents