Question

I notice that when I am deploying a database from a VS2012 Database project that the physical file paths of my data files are bound to SQLCMD Variables ($(DefaultDataPath)$(DefaultFilePrefix) OR $(DefaultLogPath)$(DefaultFilePrefix)) depending on file type.

If I had for example 4 files (primary, log, file1, file2) and I wanted to script this out to deploy each file on to a different drive (and possible folder schema) is there a way to configure this in Visual Studio?

Was it helpful?

Solution

You'll need to create project level variables (such as the above for $(DefaultLogPath) ). You'd then use those in your storage SQL commands. You'll probably want to default them as well and you could run into issues if the paths don't exist on the box. I've used that in the past to ensure placement on different drives or in different folders.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top