IsIdentity

  • Hi folks,

    How can you know, from the information_schema.columns view, if a column is identity or not? Is there another view I can join on to get that information, or any kind of function I may not know?

    I'm trying to dynamically insert default values for a table, and I do not want to insert in a identity column.

    Thanks,

    Cheers,

    J-F

    Cheers,

    J-F

  • The INFORMATION_SCHEMA views won't give you that information. You need to look at sys.columns to determine if it is an identity column.

  • I have to correct myself. there is another way, using the following function: COLUMNPROPERTY ( id , column , property ).

    Check it out in BOL (Books Online).

  • Nice!

    Thanks Lynn, I'll look the columnProperty.

    I knew there must've been another way, on the other hand, I could always join the sys.columns.

    Thanks,

    Cheers,

    J-F

    Cheers,

    J-F

Viewing 4 posts - 1 through 3 (of 3 total)

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