go-sqlcmd icon indicating copy to clipboard operation
go-sqlcmd copied to clipboard

EXIT command not parsed in powershell using -Q

Open amafernandes opened this issue 1 year ago • 0 comments

In go-sqlcmd 1.6.0 the powershell script bellow, produces and error, this is output of variable $result:

Msg 102, Level 15, State 1, Server ., Line 4 Incorrect syntax near ':'.

Running the same script using ODBC sqlcmd works properly.

$result = sqlcmd -b -X1 -E -W -h -1 -Q "
Select 2;

:EXIT(SELECT 200)"

echo $LASTEXITCODE
echo $result

amafernandes avatar Apr 05 '24 10:04 amafernandes