Visual Studio 2008 Database Project for SQL Server 2008
The project has placeholders for SQL scripts before and after deployment. They work - well, in most cases anyway.
The project has the Always-Recreate-Database option: discard the existing database and create a new hot database every time.
When deploying my database, the entire SQL Script is created and executed.
My database is used for replication, and as part of the Post-Deployment script, I designate the server as a distribution, create replication, and add articles to it.
Therefore, I need to disable replication. And the logical place to put in Pre-Deploy.
VS2008 pretty quickly wiped a smug grin. If the Always-Recreate-Database is checked, then it places the Script to delete and recreate the database, then it places my pre-deployment script, and then everything else.
Is there a way to modify the database project template so that SQL scripts are executed before deployment, where they are intended to be executed - before any deployment occurs.
sql sql-server visual-studio-2008 database-project
Raj more
source share