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

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -