SQL Server 2005,需要脚本来检查表上的所有约束
我继续收到此错误:
Object '%s' cannot be renamed because the object participates in enforced dependencies
我需要找到一个脚本来帮助我找到此表的所有依赖项。 我需要删除它们,重命名,然后将它们带回来。
SQL Server 2005
I continue to get this error:
Object '%s' cannot be renamed because the object participates in enforced dependencies
I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rename, then bring them back.
SQL Server 2005
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
禁用所有限制
重新启用
您应该能够轻松地将其调整为仅适用于一张表。
To disable all contraints
To Re-enable
You should easily be able to adapt this to just one table.
这篇文章包含我最初为 SQL Server 2000 编写的数据库逆向工程脚本并移植到 2005。如果您查看处理外键关系的部分,您可以看到如何从数据字典中获取依赖关系。
This posting contains a db reverse engineer script that I originally wrote for SQL Server 2000 and ported to 2005. If you look at the bit that does foreign key relationships you can see how to get the dependencies from the data dictionary.