SQL Server 2008表设计器中无法保存修改

当使用Microsoft SQL Server 2008 Management Studio时,有时在表设计器中对表所做的更改无法保存,具体表现为:点击保存按钮后弹出保存对话框提示:不允许保存修改(Saving changes is not permitted),弹出的对话框只有2个按钮可以点击,一个Cancel一个Save Text File,前一个就不用说了,后一个保存的文件根本没意义(可以自己试一下),而且在点击Cancel后还会提示:用户退出了保存对话框(无语,不让用户保存修改,最后还说是用户自愿的),这个挫设计导致用户当前所做的所有修改都无法保存。

解决方法可以根据错误描述中“enabled the option Prevent saving changes ”找到:

禁止这个警告显示,在Management Studio设计器中,点击菜单Tools > Options > Designers > Table and Database Designers >去掉选项Prevent saving changes that require the table to be re-created之前的复选框

原因:

当前的修改动作会导致数据库表被删除,然后重新建立;如下原因会导致表需要重新建立

  • 在表的列中间插入一个新列
  • 删除已有列
  • 修改列的是否为空标识
  • 修改列顺序
  • 修改列类型

  • 保存对话框的完整错误描述:

    “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.”

     

    参见MSDN原文:http://msdn.microsoft.com/en-us/library/bb895146.aspx

    原文地址:https://www.cnblogs.com/andy65007/p/1739007.html