Home > SQL Server > @@MAX_CONNECTIONS function – SQL Server

@@MAX_CONNECTIONS function – SQL Server


@@Max_Connections function returns the maximum number of simultaneous user connections allowed on an instance of SQL Server. We get an integer number as an output from this function. We can also reconfigure maximum connections value using sp_configure function.

Implementation

1. Select Max_connections, returns maximum connections allowed by the SQL instance.

pic1We can also use DMV get more information about the current connections and sessions of the SQL Server.

sys.dm_exec_connections – Returns information about the SQL Server connections

sys.dm_exec_sessions – Returns information about all active user connections and internal tasks.

This example gives you the remaining allowed connections:

pic2

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: