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 2000 Forums
 SQL Server Administration (2000)
 Identity Property

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2007-05-29 : 09:22:51
Guys,

Are there any system tables where you query for all the columns in the database which have identity property?

I have tried using syscolumns table and information_schema.columns view for this purpose but find any field which points to the identity column

Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-29 : 09:49:46
[code]select
Object_Name(id) as [Table Name],
name as [Column Name]
from syscolumns
where
columnproperty(id, name, 'IsIdentity') = 1[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -