You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a quick local check and found DisableVariableSubstitution was being set to true when -x was present. The bug is likely in the implementation of how DisableVariableSubstitution is used. I did not trace it any further than that.
As far as I could tell there is no escape character for $(. My work around is to do character substitution in the script before running sqlcmd to avoid the error caused by sqlcmd finding $( in the sql script.
My actual case is a script that is inserting Javascript in the field of a table. I simplified the example in my issue report.
In go-sqlcmd 1.7.0 the -x parameter doesn't appear to be working and leads to an error. Running the same script using ODBC sqlcmd works properly.
testsql.sql contents:
SELECT '$('
Example command usage:
sqlcmd -i testsql.sql -x
Example output when not working:
Sqlcmd: Error: Syntax error at line 1
The text was updated successfully, but these errors were encountered: