VS2010 Database Compare. How do you create a *.DBSchema extensioned file?

好久不见. 提交于 2019-12-22 07:11:41

问题


I'd like to take a snapshot of my database, make some changes and then use the db compare functionality to identify the changes, and who knows, maybe even generate scripts to make the change.

I'd like to avoid having to backup the current db and restore it as a separate db just to have a "before" snapshot. I'm guessing I shouldn't have to.

Obsviously, I'm clueless about db projects and am looking to be pointed in the right direction.

ty!


回答1:


On the machine which you will generate the schemafile, do the following: Download Microsoft SQL Server Compact 3.5 Service Pack 2 for Windows Desktop. Install 32 bit version first, then 64 bit (if your server is 64 bit)

Copy the files in (Program Files\Microsoft Visual Studio 10.0\VSTSDB\Deploy) to the machine on which you will run VSDBCMD.EXE, ignore the CE files in step 2, you have already installed these in the Compact SQL install above.

Read and understand Command-Line Reference for VSDBCMD.EXE http://msdn.microsoft.com/en-us/library/dd193283.aspx

Generate the dbschema file by running this from the command prompt: VSDBCMD /a:import /cs:"DbConnectionString" /dsp:SQL /ModelFile: outputfilname.dbschema




回答2:


I'm using VS2010 Premium and I was able to do the following:

  1. In Server Explorer, add a Data Connection to database A and database B
  2. Right click on database A and choose Compare Schema
  3. Pick database B as the Target, set the options/variables, then click OK

I also have SQL Server Developer Edition installed...so maybe that is what adds this functionality.

Not sure why, but this didn't work for a SQL Azure database.



来源:https://stackoverflow.com/questions/2762398/vs2010-database-compare-how-do-you-create-a-dbschema-extensioned-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!