sql server 2008 - sqlcmd mode from SSMS - setvar assignment to a substitution variable possible? -


I'm enabling SQLCMD mode from SQLMS 2008R2.

With the code below: < P> I see the following in the result:

  Hello $ (greeting)   

I was expecting to see:

  Hello Hollow   

Is there a scripting variable in the assignment of another scripting variable? If so, what is the syntax? Variable replacement: SETVAR does not work, because in this case it is just a token replacement; variable replacement in

You can emulate such behavior:

 : SETAR GREETING "Hello" DECLARE @ Salutation VARCHAR (5) = $ (greeting); SELECT @salutation;   

Regards.

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -