Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 return columns who's (Is Identity) is true

Author  Topic 

Angate
Starting Member

24 Posts

Posted - 2010-12-01 : 14:51:24
I am writing a program that generates some of my most commonly written SQL scripts, and I am looking for where the (Is Identity) value is stored for a particular column. Currently I am getting the column information from "INFORMATION_SCHEMA.COLUMNS", but I do not see where the is identity, identity increment and identity seed are stored.

Anyone know?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2010-12-01 : 15:15:15
[code]sys.identity_columns[/code]
Go to Top of Page

Angate
Starting Member

24 Posts

Posted - 2010-12-01 : 21:32:29
Thank you, that is exactly what I needed!
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-12-02 : 07:34:52
or

SELECT name FROM sys.columns WHERE is_identity = 1
Go to Top of Page
   

- Advertisement -