How to check if column has set to identity??

  • How to check if column has set to identity??

  • one way is to look at sys.columns, which has an is_identity indicator:

    select

    object_name(object_id) as TableName,

    name As ColumnName,

    is_identity

    from sys.columns

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (7/10/2012)


    one way is to look at sys.columns, which has an is_identity indicator:

    select

    object_name(object_id) as TableName,

    name As ColumnName,

    is_identity

    from sys.columns

    nice script lowell.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thank you!!

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

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