Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Cergy
    Posts
    65

    Question Unanswered: Identity field with a query ?

    I want to kown if a field is an identity (counter) using a query or a stored procedure ?


    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Returns all identity columns in a database:
    Code:
    select	sysobjects.name as tablename,
    	syscolumns.name as IdentityColumnName
    from	sysobjects
    	inner join syscolumns on sysobjects.id = syscolumns.id
    where	syscolumns.autoval is not null
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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