I would like to learn how to fetch list of all tables that has identity columns from a MS SQL database.
The script below will do:
SELECT a.name as TableName, CASE WHEN b.name IS NULL THEN 'No Identity Column' ELSE b.name END as IdentityColumnName FROM sys.tables a LEFT JOIN sys.identity_columns b on a.object_id = b.object_id