Altering a Table – “Saving Changes is Not Permitted”

So you may or may not know this. SQL Server 2008 and up have a restrictive setting for altering tables (to prevent users from shooting themselves in the foot). To get around this message, go to Tools>Options>Designers; then un-check “Prevent saving changes that require table re-creation”.

That is well and good but has lead me to ask the question, what changes will require table re-creation? Here is what I found:

  • Changing column sizes.
  • Setting a column to allow nulls or to not allow nulls.
  • Changing a column type to a type that does not convert well. Int to bigint is fine but nvarchar to text requires table re-creation.
  • Changing foreign key constraints.
  • Modifying identity properties of columns.

Here is something that you can do though:

  • Add  a column and it’s properties.
  • Delete a column, kind of strange since this would be destroying data. What gives Microsoft?
Advertisements

6 thoughts on “Altering a Table – “Saving Changes is Not Permitted”

  1. The Save (Not Permitted) dialog box warns you that saving changes is not permitted because the changes you have made require the listed tables to be dropped and re-created.

    The following actions might require a table to be re-created:

    Adding a new column to the middle of the table

    Dropping a column

    Changing column nullability

    Changing the order of the columns

    Changing the data type of a column

    To change this option, on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. Select or clear the Prevent saving changes that require the table to be re-created check box.

Have an opinion? Leave an opinion!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s