How do you prevent the deployment of the VS2010 Database Project when creating a drag and drop database?

Suppose you have a database project and you do not have "Always recreate the database" in the settings of Database.sqldeployment. Suppose you deployed a server on which there is already a database by the name of the one you are deploying.

In what other cases will a database deployment generate a script using the DROP DATABASE statement?

If you ever never want your database to be deleted when you deploy the script generated by right-clicking on the database project and selecting Deploy, what are some of the steps you can take to prevent this

+5
source share
1 answer

In addition to "Always recreate the database", without being disconnected, you should also check the "Development" tab on the "Database Project Properties" page. Be sure to identify the target connection. When you do not define one, the project will always and only deploy as if the target database does not exist. This behavior is a feature. See the link for more details.

My suggestion is to create a connection using Windows authentication so that each user has access to the extension to which they had to connect.

Also note that you will need to do this for each deployment configuration (e.g. debugging, release, etc.).

, script , !

+3

All Articles