Posted on

WITH cte AS ( 
SELECT + '.' + AS TableName, AS ColumnName
FROM sys.tables t
INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
INNER JOIN sys.columns c ON c.object_id = t.object_id
AND c.is_identity = 1
IDENT_SEED(TableName) AS Seed,
IDENT_INCR(TableName) AS Increment,
IDENT_CURRENT(TableName) AS LastIdentity
FROM cte
order by TableName

Leave a Reply

Your email address will not be published. Required fields are marked *