- Create the script
- enable SQLCMD mode
- Run the above query
:setvar workpath "c:\scripts\":setvar FileToexecute "test3.sql"--:r $(workpath)$(FileToexecute):r $(workpath)test1.sql:r $(workpath)test2.sql
enabling the SQLCMD mode
using :r
joining :r with variables
unable to use buildin sqlcmd variables