Monday, December 29, 2008

@@CONNECTIONS and @@MAX_CONNECTIONS

@@CONNECTIONS returns the number of attempted connections, either successful or unsuccessful since SQL Server was last started.Connections are different from users. For example, Applications can open multiple connections to SQL Server without the user observing the connections.
Syntax: - Select @@CONNECTIONS
@@MAX_CONNECTIONS is the maximum number of connections allowed simultaneously to the SQL server. The number returned is not necessarily the number currently configured. The actual number of user connections allowed also depends on the version of SQL Server installed and the limitations of your applications and hardware.
To Change the max connections, Use sp_configure
Syntax: - Select @@MAX_CONNECTIONS
@@CONNECTIONS is incremented with each login attempt, therefore @@CONNECTIONS can be greater than @@MAX_CONNECTIONS.
 
Example: -
SELECT GETDATE() AS 'Current Date and Time',
@@CONNECTIONS AS 'Login Attempts',
@@MAX_CONNECTIONS AS 'Max Connections Allowed'

7 comments:

  1. Hi i have a question is 32767 is the maximum size of user allowed in sql server its same in all sql server version or every edition contain different number.

    ReplyDelete
  2. Before your blog, I didn't know about this connection. Thank you for telling me this difference. At this time, Furnace Repair Services In Fort Worth TX bring the chance for you, you can save your investment save under the experts.

    ReplyDelete
  3. Hey poeple! I know that its not really simple to write a excellent essya but you can attempt to this service! Check this website and be the best! This professional personal statement writing services is the best on! So go or it and enjoy! Like this one!

    ReplyDelete
  4. The top quality data you present to your guests best takeout chinese food near me
    Will be back again conflictingly to pick what is happening with new posts.

    ReplyDelete