Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Identity_Insert

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-07-17 : 07:39:40
Neetu writes "I am trying to use SET IDENTITY_INSERT [table name ] on/off
by dynamically passing the table name. Here is what I am trying to do. But this doesn't work. The table name has to change dynamically.

declare @x varchar(100)
set @x= 'SET IDENTITY_INSERT ' + 'par_0100_IN_INSPECT' + ' ON'
Print @x
Exec @x

Is there an alternate way to do this .Please help......"

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-07-17 : 07:55:44
Maybe
Exec (@x)
instead of
Exec @x

- Vit
Go to Top of Page
   

- Advertisement -