It is possible to change the SQL Server's default (which is
-1 or indefinite period of time)
LOCK_TIMEOUT value session-wide.
Is it possible to set
LOCK_TIMEOUT default value server-, instance- and/or database-wide? If not, why not?
No it isn't possible to set this as a default and change it from -1 (no timeout).
If it needs to be changed, you have to be explicit with a call to
As for why there is no way to alter the default, we can only speculate. But my guess would be that the lack of a timeout would satisfy the majority of requirements for queries, and need to have a lock wait timeout is a pretty corner case scenario, requiring a simple
Regardless, you're talking about client-side handling. Not server-side. In fact, most providers that I work with by default enforce a command timeout (i.e.