Re: Using identity_insert in a stopred procedure with a variable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Whats so special about operators, built-in classes and modules?
    ... will prevent people from modifiying string. ... Aside from the issue of C strings, I'd say the way const is used in functions is b0rken in C. Take int foo; Since bar is passed by value, any modifications of it in the body of the function are only local to the function. ... And the syntax for that is really confusing -- generally the syntax for pointers is really confusing in C as a general rule. ... As for multiple inheritance vs. single inheritance, I think the problem isn't a technical one, it's a human one. ...
    (comp.lang.ruby)
  • Re: Function shortcut help
    ... Helmut, and Tony: ... Sorry for the confusing post, ... Public Function MyResult(x As String, ...
    (microsoft.public.word.vba.general)
  • Re: My fight with classes :)
    ... I got started to try a concatenation of 2 type of string, ... It was confusing to design your class in such a way that "k+'aks'" ...
    (comp.lang.python)
  • Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
    ... ubiquity of the "string" datatype. ... I'm not so sure I see at as any more confusing than an already ... compile would still fail because the compiler would try to link against ... properly respected by any source units. ...
    (borland.public.delphi.non-technical)
  • Re: Predicting the Future and Kolmogorov Complexity
    ... your explanation of k and Shannon Information accords ... complexity may well be quantifiable, ... to the source string), k scales with the string, thus destroying the ... course, for most people, this description is very confusing since it ...
    (talk.origins)