简体   繁体   中英

Versioning Databases using the VS 2010 Database project

Please note that this question is similar but not the same as mine: Is it possible to use MS VS Database Project as a complete solution for database versioning?

I'm trying to work out if there is a way of using the database project to perform versioning of our databases. We have customers in the field who are not modifying our database schema at all (maintained product). What I would like to be able to do is modify the DB project as required during a development cycle and then generate a single change script that will be rolled into my upgrade for our customers.

I was thinking that this will have to be a manual process where I keep a clean snapshot of the previous database version and then generate the deploy script against it before release. The only issue I have with this is that it is a manual process.

Is there something I've missed with the DB project that lets you do this easily? The deploy tool is great but I don't have access to our customer's databases to synchronise them using Visual Studio.

Yes it is possible but it relies on the vsdbcmd utility. You can use the utility even without the full-blown Visual Studio (but it does require some SQL libraries). Google the utility and/or (if you have visual studio) CD to the \\Program Files(x86)\\Microsoft Visual Studio nn\\VSTSDB\\Deploy folder and do a 'vsdbcmd /?' to get the help. The key artifact the utility produces is the .dbschema file (you use 2 of them and the /a:deploy action to do a compare). This only works for schema changes (not data changes which I believe are available in the VS gui). Best of luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM