vsdbcmdexe overriding variable value
When you deploy a database project with the command line utility vsdbcmd.exe you may want to change the value of some variables of the project. Suppose you’ve created a variable called Path1
And you have used this variable to specify the location of the files
|
|
Now you want to decide at deploy time the physical location of your database. The main problem is that vsdbcmd.exe takes deploy variable from the Database.sqlcmdvars file, so if you want to change a value of a variable you have two options. The first is using some xpath knowledge to change the value in the Database.sqlcmdvars, since it is a simple xml file.
|
|
With some Xpath knowledge you can change the value of the property Path1, suppose you change to v:\ (v is my ramdisk), then you run the vsdbcmd.exe and you will find that files are created indeed in the correct location
If you do not like using XPath to change the configuration file, you can use a series of preconfigured files and swap before calling vsdbcmd.exe. Sadly the documentation states that you have an option to choose variable file
But actually you get an error when you use it.
Alk.
Tags: Visual Studio .Net