2

i am trying to compare a database to a dacpac using SQLPackage.exe, I am having no luck, i tried the following below, but i cant find anything to do the comparison,

/a:Script /sf:"xxx:\Users\xxxxxx\Desktop\xxxxxxxx\xxxxxxxx\mydatabase.bak" /tf:"xxx:\Users\xxxxxx\Desktop\xxxxxxxx\xxxxxxxx\mydacpac1123.dacpac" /variables:msdb="C:\Repos\xxxxxxxx\xxxxxxxx\xxxxxxxx\xxxxxxxx\Snapshots\msdb.dacpac" /variables:master="C:\Repos\xxxxxxxx\xxxxxxxx\xxxxxxxx\xxxxxxxx\Snapshots\master.dacpac" /tdn:"xxxxxxxx" /op:"xxx:\Repos\xxxxxxxx"

However I have tried using help on the sqlpackage but I can’t find anyway for comparison.

bfontaine
  • 18,169
  • 13
  • 73
  • 107
OnAngelsWings
  • 19
  • 1
  • 8
  • Shouldn't it be `/a:DeployReport`? Per the doc here: https://msdn.microsoft.com/library/hh550080(vs.103).aspx#Anchor_5 – RBarryYoung Apr 10 '18 at 13:54
  • I did try that however it tells me that i need a dacpac under both sf and tf – OnAngelsWings Apr 10 '18 at 14:06
  • Because `/tf` is supposed to be a *target* dacpac, not the source. I think that the parameter `/sf` is your source dacpac and then you use either `/tcs` or other target qualifiers to specify the target database (`/tsn`, `/td`). – RBarryYoung Apr 10 '18 at 15:23
  • This question has some examples: https://stackoverflow.com/questions/21110955/why-is-my-sqlpackage-deployreport-returning-an-empty-report – RBarryYoung Apr 10 '18 at 15:25

2 Answers2

0

@RBarryYoung You were right, the post or answer from the thread you posted helped immensely,

Ill drop the answer below, thanks for all the help

SqlPackage.exe /action:DeployReport /TargetConnectionString:"{connection string}" /SourceFile:"{dacpac file}" /OutputPath:"{output file}"
OnAngelsWings
  • 19
  • 1
  • 8
0

SQLPackage.exe does not support compare a database to dacpac file. However, you can try the solution provided here: The TargetFile option is not applied to the Script Parameters and Properties section

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31