Sample Header Ad - 728x90

How do I get SSMS to use the relative path of the current script with :r in sqlcmd mode like SSDT does?

13 votes
4 answers
7852 views
If I have foo.sql and bar.sql in the same folder, foo.sql can reference bar.sql when run from SSDT in sqlcmd mode with :r ".\bar.sql". However, SSMS won't find it. Procmon shows SSMS is looking in %systemroot%\syswow64: Annotated Procmon screenshot How do I tell SSMS to look in the folder that the current script is saved to without explicitly declaring the path?
Asked by Justin Dearing (2727 rep)
Feb 6, 2015, 03:24 PM
Last activity: Apr 12, 2024, 09:47 PM