1

As the SQLPackage manual here when calling publish action, we have the argument TargetDatabaseName or tdn (in section Target Parameters)

But when adding this parameter to SQLPackage call, I got the error saying that the argument is not valid.

Example:

SQLPackage.exe 
  /a:Publish 
  /SourceFile:"Path\to\My\CompiledDbProjectFile.dacpac"       
  /TargetUser:"SomeLoginName"  
  /TargetPassword:"SomePassword" 
  /TargetServerName:"SomeSQLServerInstance" 
  /TargetDatabaseName="SomeDatabase" 
  /p:BlockOnPossibleDataLoss=true 
  /p:DropRoleMembersNotInSource=false 
  /p:DropPermissionsNotInSource=false 
  /p:DropObjectsNotInSource=false

Is that a bug? How can we work around for that?

Currently I have to use the /tcs:"The connections tring goes here"

SteveC
  • 15,808
  • 23
  • 102
  • 173
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
  • 1
    Could you give an example of the arguments you are passing to SqlPackage? Note that arguments should look something like "SqlPackage.exe /a:publish /tdn:mydb /tsn:(localhost) /sf:myfile.dscpac". For overriding deployment properties you use the format "/p:CreateNewDatabase=true" – Kevin Cunnane Dec 25 '13 at 14:01
  • @KevinCunnane I have added the sample call – Nam G VU Dec 27 '13 at 07:00

1 Answers1

3

This syntax is wrong

/TargetDatabaseName="SomeDatabase"

The correct one should be

/TargetDatabaseName:"SomeDatabase"

Cheers

Nam G VU
  • 33,193
  • 69
  • 233
  • 372