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.
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 columnThanks |
|
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 syscolumnswhere columnproperty(id, name, 'IsIdentity') = 1[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|