In MS SQL Server Management Studio in SQLCMD Mode I use this script to run another script:
:setvar path "C:\workspace\scripts\scripts\"
:r $(path)'VERSIONS.sql'
But it gets this error:
A fatal scripting error occurred. The file specified for :r command was not found.
VERSIONS.SQL
is definitely in the specified folder. Why is this script not working when I run it?
EDIT: Something to note. The database I'm running this script against is not on my local machine. (I hope that's not the reason this isn't working)
I just solved my own problem. I changed the single quotes around VERSIONS.sql
to double quotes and it worked.
Why are they not interchangeable?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With