views:

125

answers:

1

Scenario: I have created a database table. And when I tried to add a primary key (using the SQL Server Management Studiio) to the table, it failed with an error message "Saving changes is not permitted. The changes you have made requrie the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent savign changes that require the table to be re-created."

The environment is Windows 7.

I have earlier installed it on a Windows XP SP2 and it worked.

And yes, my table is empty (freshly created).

My current workaround is to run the "Drop and Create" script. The other alternative is to create the primary key before I save the table.

Is this a bug or a limitation with the Express version?

+1  A: 

There is an option in Visual Studio that doesn't allow you to save changes that require Recreating the database. If you un-check that option everything should work.

Off the top of my head I believe it is under:

Tools > Options > Database Tools > Table and Database Designers

There you should un-check the "Prevent Saving Changes that Require Table Recreation" or something similar to this.

Waleed Al-Balooshi
It is in Tools + Options + Designers + Table and Database Designers. I will try it on the culprit installation. Will mark your answer after. :)
Syd
Under 2008 Express and 2010 Ultimate it is actually Database Tools > Table and Database Designers. I have updated my answer. Thanks.
Waleed Al-Balooshi
@Waleed. It works. Thanks again for your answer. :)
Syd