Deployment

I have a DB project I created by reverse engineering our production DB. VS DBPro is looking great! I have a few questions around deployment of database objects.

1.) I notice that VS DBPro CTP creates one file for each object in my database project (in the "...\Schema Objects\" folder). The extension for each object is .sql. We have already captured all our database objects using the VS.Net 2003 database project file extensions (i.e. .TAB for table, .KCI for ref integrity constraints, .PRC for stored procedure, etc), and we have been versioning these files in VSS for a number of years now. We would like to move to using VS DBPro, but need to know whether VS DBPro will a.) allow scripting at the same granularity (i.e. sep script for tables, KCI, logins, triggers, etc) for objects in the "...\Schema Objects\" folder, and b.) whether VS DBPro will allow us to use the same file naming convention and file extensions that the VS.Net 2003 Database Project did (i.e. .TAB for table, etc). Is this something that VS BDPro will be able to do?

2.) When we deploy changes (from dev to test to production), we create a distributable package containing both a folder (with one file per object) and a .CMD file (generated using VS.Net 2003 Database Project). Deploying a .CMD file and seperate script files allows several benefits, including a.) Control: We have very granular control over what order scripts are compiled into the DB, which has a huge impact on install execution time (for example waiting until after a table schema update (create new table schema, insert existing data into new table, drop old table) is applied before applying indexes), and b.) troubleshooting: testing teams can immediately identify the script (and therefore object) that causes a failure during install. For example, if a syntax error exists in a file, the name of the file is the same as the name of the object that caused the error).

In the CTP, I notice that the install script that is generated (one big file). In VS DBPro, is there a way give me control over what is compliled when (in order) and good way to pinpoint which objects or data in the script might be causing install issues?

3.) When I deploy changes in an install package today, I am able to include objects in my install that have not changed (for example, a "work" table that needs to be dropped and rebuilt during my install). When I do a schema compare in the VS DBPro CTP, I seem to be unable to include anything but objects that have changed in the deployment ("update") script. Is this user error on my part or will the VS DBPro product allow me to include any objects I want in the my deployment in the future?

4.) I need to make sure that I can package my changes so that it cannot be changed by anyone (we don't allow anyone to decide, on go-live day, what portions of the install they'd like to deploy; the entire installation must be deployed). In addition we need to be able to compare one deployment package to another (verify differences between patches or verify that what we originally dropped is what is about to be installed into an environment). Other than instructing DBAs to deploy directly from the VS DBPro development environment (using a schema compare), What deployment mechanisms will the VS DBPro product have (will it package my scripts into a executable/.CAB file, and/or will I be able to deploy my changes using a generated .CMD file)?

Thanks in advance!

Terry

[3548 byte] By [terryc_ms] at [2008-2-15]
# 1

Thanks a lot for your valuable comments.

In the current CTP,

1) The file naming for different database objects are fixed. We will certaninly consider your suggestion of using same file extensions as those of VS 2003 database project.

2) Yes, the install script was built in one big file. Allowing partial build and deploy (object wise) is already in our consideration. However the timeline of delivering this feature has not been set yet.

3) No mistake on your side. Schema compare does not allow updates on "Equal" objects. You mentioned a very interesting use case on schema compare updates. We will investigate the possibility of enabling this feature.

4) Package feature is currently under investigation in the team. Hope we can provide you a clearer answer in the near future.

Thanks again, Terry!

Joyce

JoyceWang_MSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 2
Please don't change the file extensions. I personally dislike PRC, TAB, etc for extensions...I prefer to use SQL for everything.
Oliwa at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 3

Don't worry, if we change it we will make it configurable, we will not abandon the .sql extension.

-GertD
"DataDude" Development Manager

GertDrapers at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 4

Thanks for your reply.

Another point I did not stress enough in the original post is that we need to be able to alter the order in which scripts are compiled. In some cases, for example, we may have a script that we need to run prior to creating or altering a table, and another script that we need to run after the table create, but prior to FKs being added to the table.

In a VS 2003 database project, I could create an install script for my DB project, and then alter the order in which objects were compiled by moving the osql commands around in the resulting .cmd file. This was not optimal but was easier to manage than what is currently in the VS 2005 DBPro deployment, where it looks like I would need to cut and paste sql scripts within the single deployment .sql file.

It would be extremely valuable for deployment of code thoughout my dev cycle if there was a way to set compilation order/dependancy for objects. That way when I create a deployment package, the resulting install would always compile my objects in the order I specified.

terryc_ms at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 5

We actually create the build script based on the object hiearchy and dependency chain; so unless you would not care about that, there should be no need to change the order of objects inside the build script.

-GertD
"DataDude" Development Manager

GertDrapers at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...
# 6
Sure, for table, proc, FK creates that is true, but where application logic is concerned we have a need to be able to control what scripts execute in order. In the past we've accomplished this in a hokey way (such as naming the application files in such a way as to trick the build script/installer into executing them in a certain order). If there was a way to simply identify script dependancies (like tasks in a project plan) the we could more clearly see what the dependancies are and control these dependancies in a more standard way.
terryc_ms at 2007-9-10 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Database Professionals...

Visual Studio Team System

Site Classified