Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if a SQL table has an identity column
Message
From
09/03/2000 20:44:39
 
 
To
09/03/2000 18:38:58
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00343873
Message ID:
00343980
Views:
30
Gar,

I don't know of a simple answer. It's easy to tell if a table has an IDENTITY column using OBJECTPROPERTY(id, TableHasIdentity) (Use OBJECT_ID() to return the id of a given database object.)

OK, check out the definition of syscolumns in the BOL. The 0x80 bit of the Status column indicates that the column has the IDENTITY property set.

Another option would be to use the Profiler to get the query that the SEM uses to load a table into the table designer.

BTW, why do you want to dynamically determine which column has the IDENTITY property set?

Good luck!

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform