Sqlcmd mode from SSMS - setvar assignment to override variable possible?
I am running this from SSMS 2008R2 with SQLCMD mode enabled.
With the code below:
:SETVAR GREETING "HELLO"
:SETVAR SALUTATION $(GREETING)
SELECT '$(GREETING)'
SELECT '$(SALUTATION)'
I see the following in the results:
HELLO $(GREETING)
I was hoping to see:
HELLO
HELLO
Is there a way to have a script variable while assigning to another script variable? If so, what's the syntax?
0
source to share
2 answers