SQL Server“不允许保存更改"错误►防止保存需要重新创建表的更改 [英] Sql Server 'Saving changes is not permitted' error ► Prevent saving changes that require table re-creation

查看:146
本文介绍了SQL Server“不允许保存更改"错误►防止保存需要重新创建表的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在SQL Server中创建表并将其保存时,如果尝试编辑表设计(例如将列类型从int更改为real),则会出现此错误:

When I create a table in SQL Server and save it, if I try to edit the table design, like change a column type from int to real, I get this error:

不允许保存更改.您所做的更改要求删除并重新创建下表.您已经对无法重新创建的表进行了更改,或者启用了选项以防止保存需要重新创建表的更改.

Saving changes is not permitted. The change you have made requires the following table to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option prevent saving changes that require the table to be re-created.

为什么必须重新创建表?我只想将数据类型从smallint更改为real.

Why do I have to re-create the table? I just want to change a data type from smallint to real.

该表为空,直到现在我都没有使用它.

The table is empty, and I didn't use it until now.

推荐答案

来自保存(不允许)MSDN上的对话框:

保存(不允许)对话框警告您,保存更改是 不允许,因为您所做的更改需要列出 要删除并重新创建的表格.

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.

另请参阅 柯尔特K(Colt Kwong)博客文章:

See Also Colt Kwong Blog Entry:
Saving changes is not permitted in SQL 2008 Management Studio

这篇关于SQL Server“不允许保存更改"错误►防止保存需要重新创建表的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆