Get the App
SLTechnology News&Howtos  ›  Database  › 

Correctly understand the options related to SQL Server configuration timeout

Shulou Source: shulou.com Published: 2022-06-01 09:39:35 09月29日 Update

Correct understanding of SQL Server configuration options "remote login timeout" and "remote query timeout"

View the settings for configuration options

Sp_configure

Remote login timed out

Reference: https://msdn.microsoft.com/en-us/library/ms175136.aspx

"The remote login timeout option specifies the number of seconds to wait before returning from a failed attempt to login to a remote server. For example, if you are trying to login to a remote server and that server is down, remote login timeout helps make sure that you do not have to wait indefinitely before your computer stops trying to log in. The default value for this option is 10 seconds. A value of 0 allows for an infinite wait.

The default value for this option is 20 seconds in SQL Server 2008.

The remote login timeout option affects connections to OLE DB providers made for heterogeneous queries.

The setting takes effect immediately without restarting the server. "

EXEC sp_configure 'remote login timeout', 35; GORECONFIGURE; GO

Remote query timed out

Reference: https://msdn.microsoft.com/en-us/library/ms189040.aspx

"The remote query timeout option specifies how long, in seconds, a remote operation can take before SQL Server times out. The default value for this option is 600, which allows a 10-minute wait. This value applies to an outgoing connection initiated by the Database Engine as a remote query. This value has no effect on queries received by the Database Engine. To disable the time-out, set the value to 0. A query will wait until it is canceled.

For heterogeneous queries, remote query timeout specifies the number of seconds (initialized in the command object using the DBPROP_COMMANDTIMEOUT rowset property) that a remote provider should wait for result sets before the query times out. This value is also used to set DBPROP_GENERALTIMEOUT if supported by the remote provider. This will cause any other operations to time out after the specified number of seconds.

For remote stored procedures, remote query timeout specifies the number of seconds that must elapse after sending a remote EXEC statement before the remote stored procedure times out.

The setting takes effect immediately without restarting the server.

"

EXEC sp_configure 'remote query timeout', 0; GORECONFIGURE; GO

Corresponding options for remote servers and linked servers

Reference: https://msdn.microsoft.com/en-us/library/ms178532.aspx

Sp_serveroption [@ server =] 'server', [@ optname =]' option_name', [@ optvalue =] 'option_value'

Connect timeout

Time-out valuein seconds for connecting to a linked server.

If 0, use the sp_configure default.

Query timeout

Time-out value for queries against a linked server.

If 0, use the sp_configure default.

Let me just briefly explain that these options are only for "outgoing connections".

Tags: Reference configuration server service just link query login explain Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info NVidia Shulou Technology Linux