Christian
Christian

Reputation: 131

update script when comparing Visual studio database project to schema file

I have created a database schema file of a customers database. I want to compare this schema file to my database project i Visual Studio 2010 to be able to script the schema changes that needs to be done to the customer database in connection to the upgrade of our client program.

For filesize matters I want to use this schema file (23MB) rather than getting a full database copy (1352 MB when zipped) from the customer.

I have no problem comparing the Visual Studio project to the schema file (no error messages or warnings) but I find no means to get the resulting update script. The error I am getting when pressing "Refresh update script" is: "you cannot write updates to the target when you compare the specified types of schema models". All export options are disabled.

Of course I understand that I can't write updates to the database schema but that is not my intention - I want to run the update script on the database at our customers server.

Is there any way I can get out the update script?

Thanks!

Upvotes: 2

Views: 3860

Answers (1)

Christian
Christian

Reputation: 131

I solved it by taking a few extra turns:

  1. I created an empty database on our local sql-server.
  2. I compared the schema from our customers database with the empty database as target in Visual Studio and updated the empty database with the change script created by Visual Studio.
  3. I compared the updated database with the new database schema from TFS.
  4. The new change script I got from Visual Studio was deployed to our customers database.

Hope this helps someone, at least I learnt from it (and will hopefully remember this until the next release).

Upvotes: 3

Related Questions