IT tutorials
 
Database
 

SQL Server 2012 : Configuration Options (part 6) - Connection-Configuration Properties

1/11/2014 8:41:01 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

6. Connection-Configuration Properties

The connection-configuration properties, as shown in Table 5, can set connection options in SQL Server.

Table 5 Connection-Configuration Properties

c19tnt005 c19tnt005

The Server Properties Connections tab (refer to Figure 5) sets connection-level properties, including defaults, number of connections permitted, and timeout settings.

Figure 5 Connections tab of Management Studio's SQL Server Properties dialog.

19.9

Maximum Concurrent User Connections

The user connections option can specify the maximum number of simultaneous user connections allowed on SQL Server. This option is a self-configuring option and SQL Server automatically adjusts the maximum number of user connections as needed, up to a maximum of 32,767 user connections.

Note
The default for the user connections option is zero, which means that unlimited user connections are allowed. For most SQL Servers, the default value for the user connections option works best. If you do set this option, do not set the value too high because each connection has overhead regardless of whether the connection is used. However, do not set the user connections option to a small value, such as 1 or 2, because this may prevent administrators from connecting to administer the SQL Server. However, the Dedicated Admin Connection can always connect.

The maximum concurrent user connections option should probably not be set to a given number of users because applications often open several connections to SQL Server. For example, ODBC- and ADO-based applications open a connection for every connection object in code — possibly as many as one for every form, list box, or combo box. Access tends to open at least two connections.

In Management Studio, the user connections configuration option can be set by typing a value from 0 through 32767 in the Max Number of Concurrent Connections box on the Server Properties Connections tab (refer to Figure 5).

The following code sets the maximum number of user connections to 10240:

EXEC sp_configure ‘show advanced options', 1; 
RECONFIGURE;
GO
EXEC sp_configure ‘user connections', 10240;
RECONFIGURE;

SQL Server service must be restarted for the user connections option to take effect.

To determine the maximum number of simultaneous user connections allowed on a SQL Server instance using code, examine the value in the @@ MAX_CONNECTIONS global variable. The number returned is not the actual number of connections nor is it the configured value; it is the maximum number allowed:

SELECT @@MAX_CONNECTIONS;

Result:

-----------
32767

Query Governor Cost Limit

In the same way that a small gas-engine governor controls the top speed of the engine, the query governor limits the queries that SQL Server can run according to the estimated query cost on a specific hardware configuration. If a user submits a query that exceeds the limit set by the query governor, then SQL Server does not execute the query. By default, the query governor cost limit option is set to 0. This value enables all queries to execute, no matter how long they take.

Note
The query governor cost limit option does not abort queries with an estimated duration of less than the limit but a longer actual duration.

In Management Studio, the query governor cost limit configuration option can be set by typing the limit in the Use Query Governor to Prevent Long-Running Queries box on the Server Properties Connections tab (refer to Figure 5).

The following code sets the query governor cost limit to 300 seconds for the entire server:

EXEC sp_configure ‘show advanced options', 1; 
RECONFIGURE;
EXEC sp_configure ‘query governor cost limit', 300;
RECONFIGURE;

In code, the query governor can also be changed for the current connection. The following code overrides the currently configured query governor cost limit value for the current connection and sets it to 15 seconds:

SET QUERY_GOVERNOR_COST_LIMIT 15; 

Tip
Use the query governor cost limit option to stop long-running queries before they start and thereby help prevent system resources from being consumed by these long-running queries.

Remote Access

The remote access option enables running local stored procedures from remote servers or remote stored procedures from the local server. By default, the remote access option is enabled.

Note
The remote access option applies only to servers added using sp_addserver and is included for backward compatibility.
Using this feature is not recommended because it will be removed in the next version of Microsoft SQL Server. Use the sp_addlinkedserver feature instead.

To disallow remote access, uncheck the Allow Remote Connections to This Server check box in Management Studio on the Server Properties Connections tab (refer to Figure 5) or set the remote access option to 0 in code:

EXEC sp_configure ‘remote access', 0;
RECONFIGURE;

SQL Server service must be restarted for the remote access option to take effect.

Remote Login Timeout

The remote login timeout configuration option specifies the number of seconds to wait before returning from a failed attempt to connect to a remote SQL Server. The default value for remote login timeout is 20 seconds.

In Management Studio, you can set the remote login timeout option by entering the new timeout in seconds in the Remote Login Timeout box on the Server Properties Advanced tab (refer to Figure 19.10).

The following code changes the default value of 20 to 30:

EXEC sp_configure ‘remote login timeout', 30;
RECONFIGURE;
Note
To cause an indefinite wait, you can change the value for the remote login timeout option to 0.

Remote Query Timeout

The remote query timeout option sets the number of seconds SQL Server waits on a remote query before assuming it failed and generating a timeout error. The default value of 600 seconds (10 minutes) seems sufficient for executing a remote query:

EXEC sp_configure ‘remote query timeout', 600;
RECONFIGURE;

In Management Studio, you can set the remote query timeout option by entering the desired time in the Remote Query Timeout (in Seconds, 0 = No Timeout) box on the Server Properties Connections tab (refer to Figure 5).

Enforce DTC

When updating multiple servers within a transaction (logical unit of work), SQL Server can enforce dual-phase commits using Microsoft Distributed Transaction Coordinator.

From code, the Enforce DTC property is enabled by setting the remote proc trans option to 1:

EXEC sp_configure ‘remote proc trans', 1;
RECONFIGURE;

In Management Studio, you can set the remote proc trans option by checking the Require Distributed Transactions for Server-to-Server Communication box on the Server Properties Connections tab (refer to Figure 6).

Note
Don't use this feature in new development work because it will likely be removed in the next version of Microsoft SQL Server. Plan to modify applications that currently use this feature.
Use the sp_addlinkedserver feature instead.

Network-Packet Size

Packets are blocks of information sent over the network to transfer requests that results between clients and servers. You can change the network-packet size from its default of 4KB by using the network packet size option. However, the network-packet size should rarely need reconfiguring. Consider this property a fine-tuning tool and use it only when the data passed tends to greatly exceed the default size, such as large text or image data.

In Management Studio, you can set the network packet size option by entering the new size (in bytes) in the Network Packet Size box on the Server Properties Advanced tab (refer to Figure 6).

The following code sets the network-packet size to 2KB:

EXEC sp_configure ‘network packet size', 2048;
RECONFIGURE;

Tip
The sys.dm_exec_connections dynamic management view contains information about the network-packet size (column named net_packet_size) used for information and data transfer.
 
Others
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us