JBone
JBone

Reputation: 3203

Visual Studio 2012 Database Projects - File path configuration

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?

Upvotes: 2

Views: 479

Answers (1)

Peter Schott
Peter Schott

Reputation: 4681

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.

Upvotes: 2

Related Questions