Wednesday, June 18

How to get list of 'identity' columns in a database

How to list identity columns available in a database, along with table names.

There are many ways to list identity columns .. but the simplest one I ever came up with is

--# Respective table name is also included.
select object_name(id) tableName, name columnName from syscolumns where status = 128


Related Posts :
1. Another way to get List of tables having 'identity' column

0 comments:





Disclaimer :
Unless, otherwise mentioned, TF's SQL tips/tricks are for Sybase ASE 12.5.x