Wednesday, 2 January 2013

Script for to find the identity column in a table



SELECT name AS HasIdentity
FROM syscolumns
WHERE OBJECT_NAME(id) = 'table_Name'
AND COLUMNPROPERTY(id, name, 'IsIdentity') = 1

No comments:

Post a Comment