SQL Server Management Studio - 添加/移动列需要删除并重新创建吗? [英] SQL Server Management Studio - Adding/Moving Columns require drop and re-create?

查看:35
本文介绍了SQL Server Management Studio - 添加/移动列需要删除并重新创建吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在添加/移动列时会收到需要删除并重新创建表的消息?我相信在添加外键约束后会发生这种情况.

Why do I get message that the table needs to dropped and re-created when I add/move columns? I believe this happens after adding foreign key constraints.

如何在不删除表的情况下添加新列?

What can I do to add new columns without dropping table?

推荐答案

如果您对简单地让 SSMS 停止唠叨更感兴趣,您可以在选项->设计器->表和数据库设计器中取消选中防止保存需要重新创建表的更改"设置.该表仍将被删除并重新创建,但至少 SSMS 不会对它产生那么多的纠缠.

If you're more interested in simply getting SSMS to stop nagging, you can uncheck the "Prevent saving changes that require table re-creation" setting in Options->Designers->Table And Database Designers. The table(s) will still be dropped and re-created, but at least SSMS won't pester you quite as much about it.

(这假设您在开发/测试环境或生产环境中工作,在该环境中,表格存在的短暂失效不会搞砸任何事情)

(This assumes you're working in an dev/test environment or in a production environment where a brief lapse in the existence of the table won't screw anything up)

这篇关于SQL Server Management Studio - 添加/移动列需要删除并重新创建吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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