I am writing a query to determine if a table has an identity column. If so I want to turn on IDENTITY INSERT ON. This query worked in my SQL Server 2000 database, but i recently restored the database to SQL Server 2005.
IF (SELECT COUNT(*) FROM syscolumns c, sysobjects o where o.id = c.id and c.autoval is not null and o.name='tblDebug') > 0 SET IDENTITY_INSERT tblDebug ON
SET IDENTITY_INSERT tblDebug OFF
Has this information changed locations in SQL Server 2005, or did it never get created because I simply restored this database to SQL 2005?