Column with identity property

  • Is there any sys table or information_schema view that gives the name of the column which has identity property associated with it.

    thanks

  • SELECT OBJECT_NAME(object_id) AS TableName, name AS ColumnName

    FROM sys.columns

    WHERE object_id = OBJECT_ID('YourTableNameGoesHere') AND is_identity = 1

    Eddie Wuerch
    MCM: SQL

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply