SQLCMD Syntax error when running script that runs fine in management studio
Posted
by Troy
on Stack Overflow
See other posts from Stack Overflow
or by Troy
Published on 2010-03-17T18:31:19Z
Indexed on
2010/03/17
18:41 UTC
Read the original article
Hit count: 572
sql-server-2008
|sqlcmd
When I run the this select '$(''test'')'
in SQL Management Studio 2008 it returns $('test')
When I run sqlcmd -S SERVER -E -d DATABASE -q "select "$(''test'')"
on the command line it returns Sqlcmd: Error: Syntax error at line 1 near command '''.
If I remove the dollar sign it works. Is the "$" a special character?
Is this a sqlcmd bug? How can I change the script to get the desired result.
© Stack Overflow or respective owner