Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 875
Chad Avatar asked May 04 '10 02:05

Chad


People also ask

How do I compare two db schemas?

To compare database definitions. On the Tools menu, select SQL Server, and then click New Schema Comparison. Alternatively, right-click the TradeDev project in Solution Explorer, and select Schema Compare. The Schema Compare window opens, and Visual Studio automatically assigns it a name such as SqlSchemaCompare1 .

How do I compare two Azure SQL databases?

Compare schemas To open the Schema Compare dialog box, right-click a database in Object Explorer and select Schema Compare. The database you select is set as the Source database in the comparison. Select one of the ellipses (...) to change the Source and Target of your Schema Compare and select OK.


1 Answers

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

like image 155
vzczc Avatar answered Oct 17 '22 13:10

vzczc