David Rogers
David Rogers

Reputation: 2643

DacPac Deploy - Adjusting Lock Timeout Period

I have a DacPac that I'm deploying to multiple databases on the same server at once. Because this puts the server under a great load occasionally you get "Lock Timeouts" on this type of deployment. When I intersected the DacPac deployment in SQL Profiler I noticed that the deployment was setting the "Lock Timeout" to 5 seconds before running the rest of the update statements:

set LOCK_TIMEOUT 5000

I would like to change that to be something higher, how do I do this?

Upvotes: 3

Views: 1303

Answers (1)

David Rogers
David Rogers

Reputation: 2643

This fellow says you can set that in the "PreDeployment" script. So following instructions here, I created a "PreDeployment" script: Script.PreDeployment1.sql, and within that I set the lock timeout to 30 seconds.

set LOCK_TIMEOUT 30000

Intercepted that in SQL profiler, seems to be being run correctly. Still not the easiest way to accomplish this, I wonder if there is a better way?

Upvotes: 4

Related Questions