below is my folder structure where Script.PostDeployment.sql is saved.
I want to define relative path in Script.PostDeployment.sql to run scripts from another folder. below folder has multiple scripts stored.
will below syntax work?
:r DB\Scripts\Release 0\Sprint1\.\.\.\.\myfile.sql
preguntado el 09 de marzo de 12 a las 16:03
The answer is "maybe". The syntax is specific to SQLCMD (:r is a SQL Command directive), but if the script is opened using SSMS, then the relative path is relative to SSMS, not the script that you are running. This can get kind of tricky. If you are only using Visual Studio or SQLCMD (command-line tool) to do the deployment, then this works. If you are going to use any other tool to do the deployment (e.g. Sql Managment Studio), then I would not use relative path.
This has cause great confusion and pain when the Developers say "It works for me" and the deployment/dba team says "it is broken".
Espero que esto ayude.