Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    12

    Unanswered: Identity Column Property

    Hi,
    It's my first time here , and my first steps with SqlServer too.
    I would like to know if there is a way to check via transact-Sql if a column has Identity Property and if so wat are the the seed and increment values.
    Thanks
    Sandu

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Here you go for the first one :

    How to find whether a column is Identity column


    select name from syscolumns where colstat & 1 = 1 and name = @ColumnName

    For the second one ...

    IDENT_SEED
    Returns the seed value (returned as numeric(@@MAXPRECISION,0)) specified during the creation of an identity column in a table or a view that has an identity column.

    Syntax
    IDENT_SEED ( 'table_or_view' )


    IDENT_INCR
    Returns the increment value (returned as numeric(@@MAXPRECISION,0)) specified during the creation of an identity column in a table or view that has an identity column.

    Syntax
    IDENT_INCR ( 'table_or_view' )

  3. #3
    Join Date
    Aug 2003
    Posts
    12
    Thanks a lot
    sandu

Posting Permissions

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