SQL SERVER–2005–在数据库中查找具有外键约束的表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL SERVER–2005–在数据库中查找具有外键约束的表相关的知识,希望对你有一定的参考价值。
SELECT f.name AS ForeignKey, OBJECT_NAME(f.parent_object_id) AS TableName, COL_NAME(fc.parent_object_id, fc.parent_column_id) AS ColumnName, OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, COL_NAME(fc.referenced_object_id, fc.referenced_column_id) AS ReferenceColumnName, f.update_referential_action_desc AS UpdateAction, f.delete_referential_action_desc AS DeleteAction FROM sys.foreign_keys AS f INNER JOIN sys.foreign_key_columns AS fc ON f.OBJECT_ID = fc.constraint_object_id ORDER BY TableName ASC, ColumnName ASC
以上是关于SQL SERVER–2005–在数据库中查找具有外键约束的表的主要内容,如果未能解决你的问题,请参考以下文章
sql server 2005 中怎么创建组和数据库的映射关系
查找与其他用户 Sql Server 2005 的距离的问题 - Haversine