我想了解如何从 MS SQL 数据库中获取具有标识列的所有表的列表.
I would like to learn how to fetch list of all tables that has identity columns from a MS SQL database.
SELECT
[schema] = s.name,
[table] = t.name
FROM sys.schemas AS s
INNER JOIN sys.tables AS t
ON s.[schema_id] = t.[schema_id]
WHERE EXISTS
(
SELECT 1 FROM sys.identity_columns
WHERE [object_id] = t.[object_id]
);
这篇关于如何获取具有标识列的所有表的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!