Home Forums Article Discussions Article Discussions by Author Discuss Content Posted by Troy Ketsdever An Identity Crisis RE: An Identity Crisis
David Bird
SSCarpal Tunnel
Points: 4669
More actions
March 23, 2005 at 8:10 am
#548499
I've used the COLUMNPROPERTY to Identify tables with Identity columns.
SELECT Distinct Table_Name,MAX(COLUMNPROPERTY (OBJECT_ID(Table_Name),Column_Name,'IsIdentity')) as Id
FROM INFORMATION_SCHEMA.COLUMNS (NOLOCK)
GROUP BY Table_Name