Reputation: 5884
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)
Upvotes: 6
Views: 7892
Reputation: 5884
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?
Upvotes: 8