Presentation is loading. Please wait.

Presentation is loading. Please wait.

DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1.

Similar presentations


Presentation on theme: "DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1."— Presentation transcript:

1 DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1

2 2 “Legacy” Database Development  Difficult to implement change management Full database backups CREATE/ALTER scripts  Difficult for offline development  Difficult to integrate into ALM Lack of proper versioning tools Lack of formal testing tools

3 The Solution: Database Development Life Cycle  Database development in Visual Studio Include databases in Visual Studio solution  Source Code Control (SCC) Let the developer declare database schema The tools figure out how to create/modify the database  Simplified Deployment  Code Analysis  Refactoring  Unit Testing  Build automation

4 CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) class Auction { int id; void MethodA(); } class Auction { int id; void MethodA(); } ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_PK PRIMARY KEY (id) ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_PK PRIMARY KEY (id) ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) class Auction { int id; void MethodA(); void MethodB(); } class Auction { int id; void MethodA(); void MethodB(); } class Auction { int id; string cacheTitle; void MethodA(); void MethodB(); } class Auction { int id; string cacheTitle; void MethodA(); void MethodB(); } Version Control ChallengeDatabaseDatabase Revision History AppApp V 1 V 2 V 3

5 -- version 1 Add table dbo.Auction IF OBJECT_ID (N'dbo.Auction', N'U') IS NULL BEGIN CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) END -- version 2 Add PK Au_PK IF NOT EXISTS (SELECT * FROM sys.key_constraints WHERE name = 'Au_PK' AND type = 'PK') BEGIN ALTER TABLE Auction WITH CHECK ADD CONSTRAINT Au_PK PRIMARY KEY (id) END -- version 3 Add UC Au_SK IF NOT EXISTS (SELECT * FROM sys.key_constraints WHERE name = 'Au_SK' AND type = ‘UQ') BEGIN ALTER TABLE Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) END -- version 1 Add table dbo.Auction IF OBJECT_ID (N'dbo.Auction', N'U') IS NULL BEGIN CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) END -- version 2 Add PK Au_PK IF NOT EXISTS (SELECT * FROM sys.key_constraints WHERE name = 'Au_PK' AND type = 'PK') BEGIN ALTER TABLE Auction WITH CHECK ADD CONSTRAINT Au_PK PRIMARY KEY (id) END -- version 3 Add UC Au_SK IF NOT EXISTS (SELECT * FROM sys.key_constraints WHERE name = 'Au_SK' AND type = ‘UQ') BEGIN ALTER TABLE Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) END Manual Versioning

6 class Auction ( int id; void MethodA(); ) class Auction ( int id; void MethodA(); ) CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) Logical Database Version Control The “Visual Studio” Approach Revision History AppApp V 1 V 2 V 3 CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) class Auction ( int id; void MethodA(); void MethodB(); ) class Auction ( int id; void MethodA(); void MethodB(); ) class Auction ( int id; string cacheTitle; void MethodA(); void MethodB(); ) class Auction ( int id; string cacheTitle; void MethodA(); void MethodB(); )

7 CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL, start DATETIME NULL, len INT NULL ) Incremental Deployment Logical Database Deployment The “Visual Studio” Approach Revision History CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) CREATE TABLE dbo.Auction ( id INT NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL UNIQUE, start DATETIME NULL, len INT NULL ) New Deployment ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) ALTER TABLE dbo.Auction WITH CHECK ADD CONSTRAINT Au_SK UNIQUE (name) V 1 V 2 V 3

8 2008 Database Data Generation Plan  Creating Databound Data Generation Plans for large database schemas was a sizable upfront investment: Each field had to be configured to use sequential databound generators Each data bound generator required a connection to a database Could not easily include data from existing databases for all tables and then customize as needed

9 Database project types Database Project Available for SQL Server 2005 and SQL Server 2008 Defines a user database Supports all objects implemented by the respective SQL Server version Server Project Available for SQL Server 2005 and SQL Server 2008 Defines server-level objects and modifications to the SQL master database Examples of server-level objects are logins and custom error messages Data-tier Application Component Defines databases that will be deployed to SQL Server Utilities A DAC is a self-contained unit of management that defines and bundles database objects and SQL Server instance objects that are associated with the database and deployment requirements

10 VSTS Database Tools Roadmap ©2009 Aspect Software, Inc. All rights reserved. 10 Offline Change management SQL 2000/2005 ALM support for databases SQL 2008 support Separated Build and Deploy No “DesignDB” required SQL 2008 R2 support SQL IntelliSense Support for 3 rd party database platforms Data-tier Application Component Projects introduced Data-tier Application Component projects and Database projects operate SxS SQL Azure support Visual Designers Single deployment engine Mission critical app support Full support for SQL objects Project system enhancements ALM feature enhancements vNext Vision Combine the best of Data-tier Application Component and Database Projects

11 Schema Compare Database Features in Visual Studio Versions Data Compare Refactoring Data Generation* Database Unit Testing* Static Code Analysis* Project System IntelliSense Build Deploy Build Integration Command Line Deploy


Download ppt "DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1."

Similar presentations


Ads by Google