4

I use VS2015 to build my database project in release mode and then copy the generated .dacpac file to my production server.

I am then running a command as follows:

sqlpackage.exe /action:publish /targetconnectionstring:"Data Source=localhost;Integrated Security=True;Initial Catalog=NorthwindDb" /sourcefile:"c:\temp\NorthwindDb.dacpac" /p:CreateNewDatabase=false

The dacpac size is around 8kb. It contains maybe 10 tables and some static data.

Then I run the command, it takes a really long time to run. Both for creating the initial database and for any upgrades. I estimate for this small database, running the above command takes around 5 minutes.

Is there a way I can improve the speed of this at all?

Certainly during the intial roll out of my application where I will be making small changes and deploying, this time delay will become a real hindrance.

Remotec
  • 10,304
  • 25
  • 105
  • 147
  • Why? Why use this method at all? Surely the existing method to install SQL Server is plenty good enough. – clifton_h Jan 01 '17 at 11:25
  • @clifton_h this isn't about installing SQL Server. It is about publishing a database project. – Martin Smith Jan 01 '17 at 12:09
  • Are you using the latest version of SqlPackage.exe? It's available here: https://www.microsoft.com/en-us/download/details.aspx?id=54106 Also, what other objects are in your database project? Are there any SQLCLR assemblies, by any chance? – Steven Green Jan 03 '17 at 18:22

1 Answers1

0

When I finished my deployment pipeline and started running SqlPackage as part of my AWS Code Deploy scripts it (for some reason) runs a lot faster.

This must be something to do with running it on the command prompt however that is at this time unexplained.

Remotec
  • 10,304
  • 25
  • 105
  • 147