重命名SQL Server中的约束? [英] Rename a constraint in SQL Server?

查看:107
本文介绍了重命名SQL Server中的约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在SQL Server中重命名约束?我不想删除并创建一个新的约束,因为此约束会影响其他已经存在的约束,因此我将不得不重新创建/更改这些约束。

Is it possible to rename a constraint in SQL Server? I don't want to have to delete and create a new one because this constraint affects other already existing constraints and I will have to recreate/alter those.

推荐答案

您可以使用<$ href = http://msdn.microsoft.com/zh-cn/library/ms188351.aspx rel = noreferrer> sp_rename 并使用 @objtype ='OBJECT'

此方法适用于sys.objects中列出的包含约束的对象

This works on objects listed in sys.objects which includes constraints

这篇关于重命名SQL Server中的约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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