开发者

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

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

开发者_StackOverflow社区

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?


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

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


It's a setting in SSMS.

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜