Greetings (and I apologise for the long post),

I'm trying to write an Add-in for VS 2010 to provide some automation
in database projects. I've received some help from the MSDN forums but
I'd like to get opinions from those of you who may have gone down this
road before.

We have some complex database projects with many dependencies. The
projects are designed to be components for other database solutions
and are themselves made up of components. We need to deploy to
external networks and have elected to set the "Deploy action" to
"Create a deployment script (.sql)".

The solution consists of a number of separate projects that make up
the components of the system. Some target deployment environments will
receive some of these components whilst different deployment targets
will receive a different mix of components.

To support this we use the "Deployment Project" method. We have a
database project that holds the pre & post deployment scripts and only
references to the component projects. When deploying a release project
the DBA has to do the following:-

Open the solution and select the particular deployment project. Check
that the project .sqldeployment file has the correct settings and set
the target connection string and target database for the deployment.
Open each referenced project and ensure that the .sqldeployment and
database connection settings are correct in each one. Point the
release at a copy of the target production database version and
deploy. The output window will show the deployment order for each of
the referenced projects. The resultant .sql scripts are then executed
in that order against the copy of production and verified as deployed
correctly. These scripts are them shipped over to the production
environment and executed against each of the production databases.

The parts that I would like to automate are the tedious comparisons of
the .sqldeployment settings and the target database connection
settings.

I can use the DTE object model to find the .sql deployment files in
each of the referenced projects and do a simple comparison of the
settings from the xml therein. I will be able to show a report on the
differences so the DBA can take appropriate action.

I did not seem to be able to find the TargetConnectionString and
TargetDatabase properties, which are stored in the .dbproj file, using
either the automation objects or the configuration manager objects. I
was advised, on the MSDN forums, to use the MSBuild object model
instead. This works fine and I will be able to include comparisons of
these settings in my report page.

The big problem is that there seems to be no way of editing the
connection properties without the IDE detecting the change and
prompting for a reload of the project(s). This can take many minutes,
whilst the database models are rebuilt, and I'd like to avoid this.
These properties can be edited in the IDE through the project
properties pages without triggering a reload and I'd be very grateful
if I could find a similar way using some sort of automation.

-- 
Regards,
noonie

Reply via email to