“Save changes is not permitted” when changing an existing column to be nullable

一笑奈何 提交于 2019-11-27 03:48:53

问题


I've got a SQL Database Table, which has 35 existing records. One of the fields in this table is called Name, nvarchar(100), not null

However, due to a recent change, I need to make this column nullable.

When I change the column to allow nulls in SQL Server Management Studio, and go to save my changes, I get the following error:

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created

How can I allow this to automatically be dropped and re-created?


回答1:


I've found the solution. Go to "Tools > Options > Designers > Table and Database Designers":




回答2:


It's a setting in SSMS.

Tools - Option - Designers - Prevent saving changes that require table re-creation




回答3:


I had the same problem; wanting to Allow Nulls for a column that previously did not. Consider MS's warning to NOT turn off this option: http://support.microsoft.com/kb/956176

And their recommendation to use Transact-SQL to solve the problem, e.g. alter table MyTable alter column MyDate7 datetime NULL

This solved it for me.



来源:https://stackoverflow.com/questions/7711026/save-changes-is-not-permitted-when-changing-an-existing-column-to-be-nullable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!