When deploying a dacpac for the first time using SqlPackage.exe how do I control the logical and physical file names for the new database.
The standard SQL statement would be:
CREATE DATABASE Bar
ON PRIMARY (NAME = 'Foo', FILENAME = '...\Foo\Foo.mdf')
LOG ON (NAME = 'Foo_log', FILENAME = '...\Foo\Foo.ldf')
It seems this is not possible out of the box with the current tools. The variables $(DefaultFilePath)
and $(DefaultLogPath)
control the location but cannot be changed from the command line.
These values can be changed by using a custom deployment contributor, see Overriding DefaultDataPath and DefaultLogPath variables when using SqlPackage to publishing a dacpac.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With