Identity – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Sun, 09 Aug 2015 08:45:01 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 TSQL Script to fetch the list of tables with identity properties https://sqlserverlearner.com/2015/08/09/tsql-script-to-fetch-the-list-of-tables-with-identity-properties/ https://sqlserverlearner.com/2015/08/09/tsql-script-to-fetch-the-list-of-tables-with-identity-properties/#respond Sun, 09 Aug 2015 08:45:01 +0000 https://sqlserverlearner.azurewebsites.net/2015/08/09/tsql-script-to-fetch-the-list-of-tables-with-identity-properties/ Below is the TSQL Script to fetch the list of tables in a database with identity column properties
[sql]
SELECT SCHEMA_NAME(T.SCHEMA_ID) AS SCHEMA_NAME,
OBJECT_NAME(T.OBJECT_ID) AS TABLENAME,
TI.NAME AS COLUMN_NAME,
TI.SEED_VALUE,
TI.INCREMENT_VALUE,
TI.LAST_VALUE AS LAST_VALUE
FROM SYS.TABLES AS T
INNER JOIN
SYS.IDENTITY_COLUMNS AS TI
ON T.OBJECT_ID = TI.OBJECT_ID
[/sql]

]]>
https://sqlserverlearner.com/2015/08/09/tsql-script-to-fetch-the-list-of-tables-with-identity-properties/feed/ 0