This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SchemaName sysname = '' | |
, @TableName sysname = ''; | |
WITH pk /* Primary Keys */ | |
AS ( SELECT t.object_id | |
, pkc.column_id | |
, ic.index_column_id pk_index | |
, pk.name AS pk_name | |
FROM sys.tables t | |
JOIN sys.schemas s ON s.schema_id = t.schema_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SchemaName sysname = '' | |
, @TableName sysname = ''; | |
WITH pk /* Primary Keys */ | |
AS ( SELECT t.object_id | |
, pkc.column_id | |
, ic.index_column_id pk_index | |
, pk.name AS pk_name | |
FROM sys.tables t | |
JOIN sys.schemas s ON s.schema_id = t.schema_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SchemaName sysname = '' | |
, @TableName sysname = ''; | |
WITH pk /* Primary Keys */ | |
AS ( SELECT t.object_id | |
, pkc.column_id | |
, ic.index_column_id pk_index | |
, pk.name AS pk_name | |
FROM sys.tables t | |
JOIN sys.schemas s ON s.schema_id = t.schema_id |