Brian's Blog

items I see across my tribes

Save not permitted in SSMS 2008

July 26
by briancarter 26. July 2009 13:21

One new feature in SQL Server Management Studio 2008 (SSMS 2008) is the ability to restrict changes that would force a table to be re-created. This is a safety valve which can be turned off, if you choose. Let’s take a look…

For those who tested the new SQL Server 2008, you probably got this message, when trying to change the columns in some tables, add columns or change NULL conditions. "Save is not permitted"... and something like tables have to be dropped and re-created. The only choice you have is to click cancel, or to choose to save the message to a text file, which is, i think, not very useful. The solution i found today is in SQL Books Online, and it is pretty easy:

Tools -> Options -> Designers, and uncheck the option "Prevent saving changes that require table re-creation".

Why did MSFT add this ?  Enter the Table Designer, right-click on the table in question and choose “Design”.  Make a change.  Clicking the “Table Designer” menu item and select “Generate Change Script” to see the required T-SQL script required to make your change.  Yes, it drops all relationships, sends your data to a temp table, and makes the change.  If the table has many rows, you may want to find a more effective way due to the data copy.

Categories: Development

Comments

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading




 Questions or Feedback, my contact information is located on my About page.


The opinions, thoughts, and comments made in these blog posts are solely my own (unless otherwise stated). They do not reflect the opinions, thoughts or practices of my employer, my universities, my family, or anyone else. Also, I retain the right to change my mind about anything I publish here without having to go back and edit posts that occurred in the past. 

These are my opinions, or just as likely, someone else's opinions that I leveraged for my own.