DB Schema compare: results differ from vsdbcmd and direct build
-
5 มีนาคม 2555 21:22
My objective is to compare my database against a master database and generate a .sql script with diffs. When I run the "deploy" (right click on the DB project from solution explorer, and run deploy) from the solution.. it builds the application and generates the diff .sql file correctly. Then I am trying to generate the same diff file using vsdbcmd command (so that I can run those commmands in TFS builds). I do the following to generate the diff file:
1. Build the DB project and generate the source source.dbschema
2. Generate the target database using the command VSDBCMD /a:import /cs:"Data Source=xxx .. (as target.dbschema)
3. Compare the source database and target database using VSDBCMD /a:deploy
The above vsdbcmd steps work and generate a .sql file. But this diff file is different from the diff file I get from the first method.
Can someone help me why I am getting different results? Thanks.
ตอบทั้งหมด
-
7 มีนาคม 2555 4:31ผู้ดูแล
Hello RajSabat,
I would like to know that at this time whether there indeed are some differences between your database project and your target database? The first time you deploy the database project in the VS, will you already write some changes to the target database? Right-click the database project->Properties->Deploy->and for the Deploy action field, do you choose the Create a deployment script (.sql) and then deploy to the database option? If so, it seems that you have already deployed some changes to the target database. And at this time when you use the vsdbcmd.exe to do the schema compare, you should get different .sql output file.
Thanks.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
- ทำเครื่องหมายเป็นคำตอบโดย Vicky SongModerator 13 มีนาคม 2555 1:37