I would suggest that this is a "design limitation".
1) As a rule, it is not required to destroy all data entered by users in the environment when changing the code.
2) Xcopy files from the database do not work, because the file is blocked by applications that use it.
Do you also intend to publish the data?
If you want to publish only changes to the database (Updated tables / sprocs NOT data). SQL scripts must be generated / run against the target database.
EDIT - add what you can do:
You cannot use the VS.NET publish function.
If you want to click data. Stop IIS (or the IIS logical object for clauses -Application / app pool). Copy mdf from destination to destination server.
If you DO NOT want to push data (Just Schema). During the loop, dev generates any scripts for: adding data (i.e., search data) table / Sproc / indexes. Be careful that the scripts are in the correct order.
Pre-deployment. Get a copy of your target dastabase database. Testing SQL Scripts
For deployment: Stop IIS (or IIS logical object for clusters -Application / app pool). Encourage code changes as you use the Publish feature.
Backing up the database of target environments. Connect to the target database and update the schema using scripts. Restart IIS
Deploying this can be automated if you are willing to spend time developing the necessary scripts and building a process around it.
As others have mentioned, VSDE 2010 webdeploy (msdeploy) tries to make this a lot easier. I myself have not used these features.
Good luck.
source share