This project has moved. For the latest updates, please go here.

Conditional Schema change script Generator

Jan 20, 2011 at 3:22 PM
Edited Jan 20, 2011 at 3:52 PM

Hello, I work for a large orginization and we are implementing Visual Studio database projects for our rather large database system.  We have built a tool to generate a deployment script of all database changes that have occured since out base build, which is the dbschema files from our last release.  We are using this tool because upper management is not 100% comfortable with the method of comparing each target system and only deploying changes that are needed that the standard vsdbcmd deployment uses.  We have however run into a small problem with this method.  In our current development project we are dropping and creating a few indexes and adding columns to tables.  This is fine when we deploy the script for build 1 to our Devint and QA environments however now when we get to build 2 the same Drop Index, Create index or Add Column commands attempt to be executed again even though they are not needed.  I believe we can handle this using a custom extension within the vsdbcmd toolset but I'm not really sure were to start with this.  Can you give me some guidance, I really hate having to manually edit the deployment script every time we generate it just to add a IF EXISTS or IF NOT EXIST wrapper around these schema objects.

 I should also note our own deployment tool which executes these script can continue past these error so it doesn't stop us dead in the water, I just don't want to have to continue to have to explain each of these errors is occuring because we deployed the change in a prior build and the tool isn't smart enough to check that...

Thanks for you time,
Michael Bulava - Database Developer

Jan 24, 2011 at 12:24 PM
Edited Jan 24, 2011 at 12:25 PM

I've started a DeploymentPlanModifier to handle this for our orgainization, the code can be found on dbprojtools.codeplex.com along with the other tools I've created for database projects.  The extender isn't complete and doesn't work for every change type yet, but I'm on a deadline and need to get something working for us as quickly as possible.  But please feel free to take a look at the code, and optimize it anyway possible I'm more of a SQL developer than a .Net developer so I may have done some things way wrong.. 

Mar 15, 2011 at 1:23 PM

Hi Michael thanks for invite to that URL, but sadly that "HomeGrown Database Project tools" gives error

This project is not yet published
If you are a coordinator or developer on this project, please sign in to access the project.

so if you open up the project I can take a look.

cheers,
Dick

Mar 15, 2011 at 1:38 PM

I'm sorry I had to remove that project, due to non-compete agreements I am unable to ne the owner of the project.

Michael Bulava

Sent from my Droid

On Mar 15, 2011 8:23 AM, "DickPershing" <notifications@codeplex.com> wrote:
> From: DickPershing
>
> Hi Michael thanks for invite to that URL, but sadly that "HomeGrown Database Project tools" gives errorThis project is not yet published
> If you are a coordinator or developer on this project, please sign in to access the project.so if you open up the project I can take a look.cheers,
> Dick
>
>