TSQL Script to fetch the list of tables with identity properties

Posted on : 09-08-2015 | By : Devi Prasad | In : Identity

0



Below is the TSQL Script to fetch the list of tables in a database with identity column properties

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



Reference : Devi Prasad (sqlserverlearner.com)

Do you like my blog?

If you liked reading this blog, please help spread the word by sharing this blog with your friends.



Need Help On SQL Server?

Cannot Find Solution to your problem (or) If you are looking for some help on SQL Server. Dont worry Click Here to Post your question and solve your issue.




Your Ad Here