View Single Post

   
  #3 (permalink)  
Old 02-29-2008, 05:16 AM
newtophp2000@yahoo.com
 
Posts: n/a
Default Re: Identity columns

Thanks, Dan! This works great.


Dan Guzman wrote:
> You might try specifying the table schema in the OBJECT_ID function

to avoid
> ambiguity. Also, consider quoting the identifiers:
>
> SELECT COLUMN_NAME
> FROM INFORMATION_SCHEMA.COLUMNS
> WHERE TABLE_SCHEMA = 'user_a' AND
> TABLE_NAME = 'tab_a' AND
> COLUMNPROPERTY(
> OBJECT_ID(
> QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)),
> COLUMN_NAME, 'IsIdentity') = 1
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>


Reply With Quote