“不允许保存更改"将现有列更改为可为空时 [英] "Save changes is not permitted" when changing an existing column to be nullable

查看:56
本文介绍了“不允许保存更改"将现有列更改为可为空时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SQL 数据库表,其中有 35 条现有记录.此表中的字段之一称为Namenvarchar(100)not null

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.

当我在 SQL Server Management Studio 中更改列以允许空值并保存更改时,出现以下错误:

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":

这篇关于“不允许保存更改"将现有列更改为可为空时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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