hi,
how to find out whether my database have identity columns or not? I
don't want to go check through all the tables one by one.Hi,
Use the below query:-
SELECT TABLE_SCHEMA+'.'+TABLE_NAME, COLUMN_NAME FROM
INFORMATION_SCHEMA.COLUMNS
WHERE COLUMNPROPERTY ( OBJECT_ID(TABLE_SCHEMA+'.'+TAB_LE_NAME),
COLUMN_NAME, 'IsIdentity' )=1
Thanks
Hari
SQL Server MVP
"Britney" <britneychen_2001@.yahoo.com> wrote in message
news:uY4Ol7UkFHA.1412@.TK2MSFTNGP09.phx.gbl...
> hi,
> how to find out whether my database have identity columns or not? I
> don't want to go check through all the tables one by one.
>
>
>|||>> how to find out whether my database have identity columns or not?
Do:
SELECT name
FROM sysobjects
WHERE xtype = 'u'
AND OBJECTPROPERTY( id, 'TableHasIdentity' ) = 1 ;
Anith
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment