Home Forums SQL Server 2005 SQL Server 2005 General Discussion SQLCMD how to use drive and path in scripting variables RE: SQLCMD how to use drive and path in scripting variables
Todd Engen
SSCrazy Eights
Points: 9869
More actions
February 1, 2008 at 6:06 am
#774148
It looks like the SQLCMD -v option is expecting the variable to be quoted.
SQLCMD -v myVariable="myValue"
To get the the variable quoted add an additional set of double quotes:
:SETVAR myVariable """N'C:\temp'"""
:!!ECHO $(myVariable)