elimesika
asked on
sqlcmd script variables
HI
I am trying to run sqlcmd with a script variable that holds a path (see code snippet)
However , sqlcmd does not know how to handle the ':' in the dir variable value and produce the following error :
Sqlcmd: ':\temp\bcp'': Invalid argument. Enter '-?' for help.
I have tried \: :: and ^: nothing is working
Please help
Thanks
I am trying to run sqlcmd with a script variable that holds a path (see code snippet)
However , sqlcmd does not know how to handle the ':' in the dir variable value and produce the following error :
Sqlcmd: ':\temp\bcp'': Invalid argument. Enter '-?' for help.
I have tried \: :: and ^: nothing is working
Please help
Thanks
sqlcmd -S.\SQLEXPRESS -d mydb -Uuser -Ppass -v dir='c:\temp\bcp' -i vdc-export-import.sql
ASKER
JagdishDevaku , the link you have provided has nothing to do with my question. This is the sqlcmd manual page, I know this manual and naturally is was my first station before I asked my question.
sqlcmd -S.\SQLEXPRESS -d mydb -Uuser -Ppass -v 'dir c:\>\\temp\bcp' -i vdc-export-import.sql
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
slam69, your second one was just what I needed
Thanks for your help.
Thanks for your help.
Please check the below link on sqlcmd and will help you you in solving the issue...
http://msdn.microsoft.com/en-us/library/ms162773.aspx
all the best...