Query to get the name of the identity column for a given table.

Posted by Lakhangarg under Sql Server category on | Views : 2829
To Get the Identity column name for Tbl_Customer we need to execute the following query.

SELECT D.name AS ColumnName, O.name AS TableName 
FROM sys.identity_columns D INNER JOIN Sys.Objects O ON O.object_id=D.object_id
Where O.name='Tbl_Customer

Thanks & Regards
Lakhan Pal Garg

Comments or Responses

Login to post response