Saving changes is not permitted The changes you have made require the following tables to be dropped and re-created. - SQL Server 2008

When you try to change something in SQL Server 2008 related to table, you may encounter a dialog saying the following message
Saving changes is not permitted The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

Normally, whenever I faced this message earlier, I used to do the change using SQL command, but today I found something interesting.

Here are the abstracts from that:

New default in SQL Server's Management Tools: When you design a table in
a database and then try to make a change to a table structure that
requires the table to be recreated, the management tools will not allow
you to save the changes. Instead you'll be greeted by this friendly
dialog:

Notice that there's no option to save the changes - it's a hard rule
that is applied upon saving and you can get past this other than back
out of the dialog.




My first thought here is "Crap! Now what?"
and off I go searching for an option to turn this off. Eventually I find
a solution after a quick search online. As it turns out it's just an annoying
configuration default setting that can be easily changed, but if you're
like me and you spend a while searching around the Management Tools and
finding nothing initially, I ended up eventually backing out of my
initial database changes and losing a bit of work in the process. It
wasn't until a bit later that I found the setting to change.
Hopefully
you'll find this entry before you back out of database changes - you
can get out of the above dialog, make the settings change and then still
go ahead and save changes to your database.
The fix is: Go to
Tools | Options | Designers | Tables and Designers and uncheck the Prevent
Saving Changes
that require table re-creation option:
and that does the trick.

Click here to read the original article by Rick Strahl's blog.

No comments:

Post a Comment