locating IDENTITY seeded columns

  • Hi all

    Im trying to write a script that lists me:

    table_owner

    table_name

    column_name

    for those tables that use IDENTITY to seed its values.

    Ive been looking around syscolumns and for the life of me cant locate what I need. Any tricks to this?

    Cheers

    Chris


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

  • SELECT

    u.[name]AS UserName

    ,o.[name]AS TableName

    ,c.[name]AS ColumnName

    FROM syscolumns c

    INNER JOIN sysobjects oON o.[Id] = c.[Id]

    INNER JOIN sysusers u ON o.[uid] = u.[uid]

    WHERE c.[status] & 128 = 128

    Chris Hedgate @ Apptus Technologies (http://www.apptus.se)

    Edited by - chrhedga on 07/25/2001 03:01:13 AM

  • Chris - excellent!

    Most appreciated...

    Cheers

    Chris


    Chris Kempster
    www.chriskempster.com
    Author of "SQL Server Backup, Recovery & Troubleshooting"
    Author of "SQL Server 2k for the Oracle DBA"

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

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