SQL Server 查询所有外键子父表关系

SELECT table_name,fk_name,reference_table_name,fk_list_number,fk_detail
FROM (
SELECT object_name(f.object_id) AS fk_name,
object_name(f.parent_object_id) AS table_name,
object_name(f.referenced_object_id) AS reference_table_name,
k.constraint_column_id AS fk_list_number,
convert(sysname, col_name(k.referenced_object_id, k.referenced_column_id)) AS fk_detail
FROM sys.foreign_keys f
INNER JOIN sys.foreign_key_columns k
on f.object_id = k.constraint_object_id and f.referenced_object_id = k.referenced_object_id
) t

上一篇:linux 打开文件数too many open files解决方法


下一篇:Opengl ES 1.x NDK实例开发之七:旋转的纹理立方体