To select value of identity columns in all tables in the selected database.
Below is the query which selects the description of identity columns in all tables in the selected database.
SELECT OBJECT_NAME(OBJECT_ID) AS
TABLENAME, NAME AS COLUMNNAME,
SEED_VALUE, INCREMENT_VALUE,
LAST_VALUE, IS_NOT_FOR_REPLICATION
FROM SYS.IDENTITY_COLUMNS ORDER BY 1
No comments:
Post a Comment