Re: Using identity_insert in a stopred procedure with a variable
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Fri, 12 Aug 2005 15:17:40 -0700
We're both confusing each other. That's why I keep the old thread in the
message so I can follow the context.
Ah, I generally build a string
Declare @strSQL as VarChar(8000)
and concatenate to it a piece at a time
SET @strSQL = 'EXEC( 'SET IDENTITY_INSERT ' + @dbname +
'..tax_transaction ON' )
and then execute the string.
EXEC(@strSQL)
hth
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Remco" <remco@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:1123873101.007777.186700@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> You are confusing me, or I'm afraid your seeing more than there is.
>
> The only problem is that
>
> EXEC( 'SET IDENTITY_INSERT ' + @dbname + '..tax_transaction ON' ) ,
> where @dbname = 'isrec'
>
> does not work, but
>
> SET IDENTITY_INSERT isrec..tax_transaction ON
>
> works fine.
>
> However, 'isrec' is variable.
>
.
- Follow-Ups:
- References:
- Using identity_insert in a stopred procedure with a variable
- From: Remco
- Re: Using identity_insert in a stopred procedure with a variable
- From: William \(Bill\) Vaughn
- Re: Using identity_insert in a stopred procedure with a variable
- From: Remco
- Re: Using identity_insert in a stopred procedure with a variable
- From: William \(Bill\) Vaughn
- Re: Using identity_insert in a stopred procedure with a variable
- From: Remco
- Re: Using identity_insert in a stopred procedure with a variable
- From: William \(Bill\) Vaughn
- Re: Using identity_insert in a stopred procedure with a variable
- From: Remco
- Using identity_insert in a stopred procedure with a variable
- Prev by Date: Help Combobox selected value when form loads.
- Next by Date: Re: Re:Rowfilter error: Cannot perform '=' operation on System.Int32 and System.String
- Previous by thread: Re: Using identity_insert in a stopred procedure with a variable
- Next by thread: Re: Using identity_insert in a stopred procedure with a variable
- Index(es):
Relevant Pages
|