Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    40

    Unanswered: identity in system tables

    does anyone know how sql 2k stores whether a column is an identity column? is it in any system tables or information_schema?

    i've read that i can't find the next value of the identity, which i find weird. I just want to know if the column is an identity or not.

    Thanks in advance.

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    SELECT COLUMNPROPERTY( OBJECT_ID('table_name'),'column_name','IsIdentity' )
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: identity in system tables

    Originally posted by fattyacid
    does anyone know how sql 2k stores whether a column is an identity column? is it in any system tables or information_schema?

    i've read that i can't find the next value of the identity, which i find weird. I just want to know if the column is an identity or not.

    Thanks in advance.
    syscolumns:
    status

    Bitmap used to describe a property of the column or the parameter:
    0x08 = Column allows null values.
    0x10 = ANSI padding was in effect when varchar or varbinary columns were added. Trailing blanks are preserved for varchar and trailing zeros are preserved for varbinary columns.
    0x40 = Parameter is an OUTPUT parameter.
    0x80 = Column is an identity column.

  4. #4
    Join Date
    Jan 2004
    Posts
    40
    Originally posted by Enigma
    SELECT COLUMNPROPERTY( OBJECT_ID('table_name'),'column_name','IsIdentity' )
    would you happen to know where sql 2k stores this information?

  5. #5
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Syscolumns

    See post by snail above
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  6. #6
    Join Date
    Jan 2004
    Posts
    40
    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •