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 - 2005-09-21 : 10:41:25
|
| Guys, I am trying search for all the columns in the database that have identity property.I ve tried to search by querying information_schema.columns but could get the results that I wanted.Any better ideas/suggestions would certainly help.Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-09-21 : 13:03:20
|
| You'll need to use the COLUMNPROPERTY function.SELECT COLUMNPROPERTY (OBJECT_ID('TableNameGoesHere'), 'ColumnNameGoesHere', IsIdentity) Tara |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-22 : 01:47:28
|
| SELECT table_name, column_name as Identity_ColumnFROM information_schema.columns WHERE COLUMNPROPERTY(OBJECT_ID(table_name),column_name,'IsIdentity')=1order by table_nameMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|