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
Hello Everyone,
in mssql-tools a SQL script can use variables even when composing a file path in :out and :r commands.
The go version is not able to expand variables in the filename of these commands:
:on error exit
:setvar WorkingDir ./tmp
:out $(WorkingDir)/file.sql
GO
PRINT '-- Test file.'
GO
:out stdout
GO
:r $(WorkingDir)/file.sql
GO
and leads the SQL script above to the following errors:
Sqlcmd: Error: Error occurred while opening or operating on file $(WorkingDir)/file.sql (Reason: open $(WorkingDir)/file.sql: no such file or directory).
Sqlcmd: Error: Error occurred while opening or operating on file $(WorkingDir)/file.sql (Reason: open $(WorkingDir)/file.sql: no such file or directory).