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

查看:28
本文介绍了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:

  • 在表格中间添加一个新列
  • 删除一列
  • 更改列的可空性
  • 更改列的顺序
  • 更改列的数据类型<<<<<

要更改此选项,请在工具菜单上,点击选项,展开设计器,然后单击表和数据库设计器.选择或清除阻止保存需要表的更改重新创建复选框.

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.

另见Colt Kwong 博客条目:
SQL 2008 Management Studio 中不允许保存更改

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

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

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