Friday, November 25, 2011

Saving changes after table edit in SQL Server Management Studio 2008

Saving changes after table edit in SQL Server Management Studio 2008
 
Question : If we want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) we get an error 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."
 
What can prevent the table to be easily edited? Or, is it the usual way for SQL Server Management Studio to require re-creating table for editing? What is it - this "option Prevent saving changes"?
 
Answer : This problem occurs when "Prevent saving changes that require table re-creation" option is enabled.
 
Go into Tools -> Options -> Designers-> Uncheck "Prevent saving changes that require table re-creation".
 
That happens because sometimes it is necessary to drop and recreate a table in order to change something. This can take a while, since all data must be copied to a temp table and then re-inserted in the new table. Since SQL Server by default doesn't trust you, you need to say "OK, I know what I'm doing, now let me do my work."
 

No comments:

Post a Comment