am-244616
SSCarpal Tunnel
Points: 4936
More actions
October 22, 2007 at 4:28 pm
#376000
Is there any sys table or information_schema view that gives the name of the column which has identity property associated with it.
thanks
Eddie Wuerch
SSChampion
Points: 12535
October 22, 2007 at 7:55 pm
#744292
SELECT OBJECT_NAME(object_id) AS TableName, name AS ColumnName
FROM sys.columns
WHERE object_id = OBJECT_ID('YourTableNameGoesHere') AND is_identity = 1
Eddie WuerchMCM: SQL
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply