Link to home
Start Free TrialLog in
Avatar of dalsandhu
dalsandhu

asked on

Using SQLCMD in Visual Studio to run sql scripts NOT IN a database project

Hi

I am part of a team using Visual Studio/Team Foundation Server to manage database development.

We are using a database project to manage schema changes.

We have a folder in TFS, not in the database project where we keep run-once-only scripts to update metadata/config data. We see no reason in keeping these in the Pre/PostDeployment script area of the database project as these files will not be updated once they have been run.

My question is: is there a way to refer to files in a TFs folder, so that I can create a single deployment script with something like:

:r "$/MyProject/MetaDataScripts/Release1/Script1.sql"
:r "$/MyProject/MetaDataScripts/Release1/Script2.sql"

where the path is refering the source location in TFS Source Control Explorer?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial