Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Correctly understand the options related to SQL Server configuration timeout

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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".

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report