January 20, 2009 at 2:06 pm
Hi folks,
How can you know, from the information_schema.columns view, if a column is identity or not? Is there another view I can join on to get that information, or any kind of function I may not know?
I'm trying to dynamically insert default values for a table, and I do not want to insert in a identity column.
Thanks,
Cheers,
J-F
Cheers,
J-F
January 20, 2009 at 2:21 pm
The INFORMATION_SCHEMA views won't give you that information. You need to look at sys.columns to determine if it is an identity column.
January 20, 2009 at 2:31 pm
I have to correct myself. there is another way, using the following function: COLUMNPROPERTY ( id , column , property ).
Check it out in BOL (Books Online).
January 20, 2009 at 2:40 pm
Nice!
Thanks Lynn, I'll look the columnProperty.
I knew there must've been another way, on the other hand, I could always join the sys.columns.
Thanks,
Cheers,
J-F
Cheers,
J-F
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply