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
> |