Offline Database Development and Unit Testing with SSDT. Andrey Zavadskiy



Similar documents
Microsoft SQL Server Review

Microsoft Training and Certification Guide. Current as of December 31, 2013

Develop your Database using Database Projects from SQL Server Data Tools (SSDT)

Microsoft Training and Certification Guide. Current as of March 16, 2015

70-243: Administering and Deploying System Center 2012 Configuration Manager : Monitoring and Operating a Private Cloud with System Center 2012

MOC MICROSOFT WINDOWS SERVER 2008 Hs Inicio Fin Días Horario Planning and Implementing Windows Server may. 6-jun.

SharePoint for Digital Asset Management

Please contact Cyber and Technology Training at for registration and pricing information.

Beginning SQL Server Administration. Apress. Rob Walters Grant Fritchey

Module 1: Getting Started with Databases and Transact-SQL in SQL Server 2008

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

Microsoft Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

SQL Server 2016 New Features!

Application Development With Data Studio

Job Description Senior Consultant (BI)

POSITION DESCRIPTION. Role Purpose. Key Challenges

Introduction to SharePoint Development. for.net developers

March Lynn Langit twitter

Catálogo de cursos plataforma elearning Microsoft Imagine Academy: Microsoft SQL Server y Visual Studio

Writing Queries Using Microsoft SQL Server 2008 Transact-SQL

HTML5. Turn this page to see Quick Guide of CTTC

East Asia Network Sdn Bhd

SQL SERVER DEVELOPER Available Features and Tools New Capabilities SQL Services Product Licensing Product Editions Will teach in class room

Microsoft Azure Cloud for Solution Architects

Job Description Senior Consultant (SharePoint)

Developing ASP.NET MVC 4 Web Applications

$100K+ Jobs Advance Careers Training, Career Coaching and Real World Work Experience Feeder pool for consulting assignments, matching the best

Creating Page Layouts using SharePoint Designer or Visual Studio

Programming Fundamentals of Web Applications Course 10958A; 5 Days

Visual Studio Team Edition for Database Professionals. Woody Pewitt Developer Evangelist

Developing ASP.NET MVC 4 Web Applications MOC 20486

CATALOG OF CLASSES IT and Technical Courses

Job Description Solutions Architect. Job Description Principal Consultant (BI) Job Title. Principal Consultant Business Intelligence.

Role- Based Training for Civil Servants (RBTCS)

How To Train Aspnet

POSITION DESCRIPTION. Role Purpose

Introduction. Introduction

Microsoft Data Warehouse in Depth

John Perrotta j.perrotta@ninesharp.co.uk

Visual studio 2008 overview

Microsoft SharePoint Server 2010: What s New and What s Changed?

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

Course ID#: W 35 Hrs. Course Content

W I S E. SQL Server 2012 Database Engine Technical Update WISE LTD.

Implementing and Administering an Enterprise SharePoint Environment

Job Description Senior Database Consultant

Implementing a Data Warehouse with Microsoft SQL Server

SQL SERVER TRAINING CURRICULUM

JOB DESCRIPTION. DATE ISSUED: 08/15 FLSA: Exempt PTO: VCS TITLE. SharePoint Administrator JOB SUMMARY

Application Development at Congruent

Course 20461C: Querying Microsoft SQL Server Duration: 35 hours

Partner Gold Learning. Microsoft TRAINING CERTIFICATION

AV-005: Administering and Implementing a Data Warehouse with SQL Server 2014

Querying Microsoft SQL Server

EXAM - A SAS Certified BI Content Developer for SAS 9. Buy Full Product.

OPEN XML SDK DEVELOPING OPEN XML SOLUTIONS. Zeyad Rajabi

Using Application Insights to Monitor your Applications

Software Development Interactief Centrum voor gerichte Training en Studie Edisonweg 14c, 1821 BN Alkmaar T:

Restoring Data with Database Snapshots

Transaction Log Internals and Troubleshooting. Andrey Zavadskiy

Deploying Web Applications in Enterprise Scenarios

POSITION DESCRIPTION. II. REPORTS TO: Manager of Application Development

Setting up SQL Translation Framework OBE for Database 12cR1

USERS, PROFILES, & MYSITES

Net Developer Role Description Responsibilities Qualifications

GSA2013: The Great SharePoint Adventure 2013

Key Benefits of Microsoft Visual Studio Team System

DBA xpress Product Overview

Pro SQL Server Reporting Services. Third Edition. mm m. Brian McDonald. Shawn McGehee. Rodney Landrum. Apress*

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

System Requirements for Microsoft Dynamics NAV 2013 R2

Implementing a Data Warehouse with Microsoft SQL Server 2012 MOC 10777

Getting Started With Your LearnDevNow Learning

Upgrades and the Cloud

Executive Summary WHO SHOULD READ THIS PAPER?

Implementing a Data Warehouse with Microsoft SQL Server MOC 20463

COURSE OUTLINE MOC 20463: IMPLEMENTING A DATA WAREHOUSE WITH MICROSOFT SQL SERVER

Developing, Deploying, and Debugging Applications on Windows Embedded Standard 7

*Not include in promotion. Update 12 November 2014

Getting started with your AppDev Microsoft Development Library

Exploring SQL Server Data Tools in Visual Studio 2013

TREINAMENTO OFICIAL MICROSOFT

MICROSOFT BUSINESS CERTIFICATION (EXAMS)

David Chou. Architect Microsoft

Key Benefits of Microsoft Visual Studio 2008

This Record of activity confirms that Jonathan Scrase has completed the following courses within the Microsoft Virtual Academy:

POLAR IT SERVICES. Business Intelligence Project Methodology

Course 10337A: Updating Your Microsoft SQL Server 2008 BI Skills to SQL Server 2008 R2

SharePoint for Digital Asset Management

BI xpress Product Overview

SharePoint 2010 Advanced Foundation Development

Visual COBOL ASP.NET Shopping Cart Demonstration

Querying Microsoft SQL Server 20461C; 5 days

TIBCO Spotfire Metrics Prerequisites and Installation

Αξιοποιείστε τα δεδομένα της επιχείρησής σας με Ms Visual Studio 2010 & Ms SQL 2008

Realistic? Content management initiatives can be a huge investment of time, money, and resources.

Implementing a Data Warehouse with Microsoft SQL Server

Myriad Technologies Training 5 Day Level 200 Introduction

Querying Microsoft SQL Server Course M Day(s) 30:00 Hours

MOC 20461C: Querying Microsoft SQL Server. Course Overview

Transcription:

Offline Database Development and Unit Testing with SSDT Andrey Zavadskiy

Thank You Presenting Sponsors Gain insights through familiar tools while balancing monitoring and managing user created content across structured and unstructured sources. Unifying computer, storage, networking, and virtualization, Cisco UCS is the optimal database and business intelligence platform for SQL Server. Supporting Sponsors Solutions from Dell help you monitor, manage, protect and improve your SQL Server environment. www.microsoft.com www.cisco.com www.software.dell.com 2 2

Planning on attending PASS Summit 2015? Start saving today! The world s largest gathering of SQL Server & BI professionals Take your SQL Server skills to the next level by learning from the world s SQL Server experts, in over 190 technical sessions Over 5000 attendees, representing 2000 companies, from 52 countries, ready to network & learn Contact your Local or Virtual Chapter for an additional $150 discount. $1795 until July 12 th, 2015

Andrey Zavadskiy Solutions architect, SQL &.NET developer 20 years in IT industry Worked with SQL Server since 7.0 back in 2001 Developed in Visual Basic, C#, ASP.NET, MVC, JavaScript, SharePoint MCSE, MCSD, MCT http://andreyzavadskiy.com https://www.facebook.com /andrey.k.zavadskiy @AndreyZavadskiy https://www.linkedin.com /in/zavadskiy 4

Session Goal Provide a practical overview of how to use SQL Server Data Tools to create, test and deploy a database project 5 5

Contents Offline database development Creating a database project Creating database objects and writing T-SQL code Project properties Deployment Deployment scripts for inserting data Database unit testing Objects to be tested Unit test flow Creating and running unit test Debugging database objects in unit test Custom unit test conditions 6 6

Concept of SQL Server Data Tools Focusing on the final version of code rather then on many ALTER iterations The unique IDE for all database developer s needs Based on Visual Studio Working with connected databases (like SQL Server Management Studio) Project approach to code writing Debugging and unit testing Version control (via integration with Team Foundation Server) 7 7

Offline Database Development Creating a database project Creating database objects Import from existing database Creating from scratch Project properties Project and database settings Code analysis 8 8

DEMO Creating a database project 9 9

Database Deployment Deployment in the connected database Publishes the script (CREATE) Compares against the target database Creates a change script (ALTER) Runs the change script on the target database Deployment in the disconnected database Creates a DACPAC package Distribute and publish DACPAC Compares DACPAC against the target database Creates a change script Runs the change script on the target database Publishing profiles and settings 10 10

DEMO Publishing a database 11 11

Deployment Scripts For Inserting Data Creating scripts Based on the existing data From scratch Various types of scripts Pre-deployment Post-deployment 12 12

DEMO Scripting data for deployment 13 13

Database Unit Testing Unit test Is performed on a smallest piece of testable code Isolated from the other pieces of code Should be repeatable Gives the answer to only one question Usually created by developers 14 14

What for? Confidence in your code Confirms that product requirements are working Early error checking of code Instant visual feedback on errors Helps to check subsequent changes in code Provides documentation for other developers 15 15

Where are the bugs? Invoked unit of code Dependency Unit of code Test 16 16

What can be tested? Meta-data Table structure, field type and length Existence of objects Constraints CHECK, DEFAULT, PRIMARY KEY, FOREIGN KEY, UNIQUE T-SQL code Stored procedures, Functions, Triggers Security permissions Execution time 17 17

Data that can be tested Scalar values Normal values Errors (incorrect values) Very big values NULL Table values Rowset Empty rowset Very big rowset Metadata 18 18

Unit Test Flow Test initialize Unit test Pre-test Test Post-test Test cleanup Can have more than one test condition Can handle exceptions raised in database Can be run within a transaction 19 19

DEMO Creating and running a database unit tests 20 20

Debugging in unit tests Can debug only the T-SQL code to be tested Breakpoint can be set inside the stored procedure, function or trigger Can t debug the T-SQL code of the unit test itself 21 21

DEMO Debugging a code from within a database unit test 22 22

Custom unit test conditions Are a Visual Studio IDE extensions Created in a separate project as a class library Compiled to a DLL How-to in MSDN article Custom Test Conditions for SQL Server Unit Tests https://msdn.microsoft.com/en-us/library/jj860449(v=vs.103).aspx Example in my CodePlex project https://ssdtconditions.codeplex.com/ 23 23

DEMO Using a custom test conditions 24 24

References MSDN: SQL Server Data Tools https://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx SSDT Team Blog http://blogs.msdn.com/b/ssdt/ MSDN Forum https://social.msdn.microsoft.com/forums/sqlserver/en-us/home?forum=ssdt 25 25

Questions?

Thank You for Attending Follow @pass24hop Share your thoughts with hashtags #pass24hop & #sqlpass

Coming Up Next SQL Server Agent: The Life Preserver for the Drowning DBA Lance Tidwell