Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
@@CONNECTIONS (Transact-SQL)
Collapse the table of content
Expand the table of content

@@CONNECTIONS (Transact-SQL)

Returns the number of attempted connections, either successful or unsuccessful since SQL Server was last started.

Topic link icon Transact-SQL Syntax Conventions


@@CONNECTIONS

integer

Connections are different from users. Applications, for example, can open multiple connections to SQL Server without the user observing the connections.

To display a report containing several SQL Server statistics, including connection attempts, run sp_monitor.

@@MAX_CONNECTIONS is the maximum number of connections allowed simultaneously to the server. @@CONNECTIONS is incremented with each login attempt, therefore @@CONNECTIONS can be greater than @@MAX_CONNECTIONS.

The following example shows returning the number of login attempts as of the current date and time.

SELECT GETDATE() AS 'Today''s Date and Time', 
@@CONNECTIONS AS 'Login Attempts'

Here is the result set.

Today's Date and Time  Login Attempts
---------------------- --------------
3/27/2005 10:32:45 AM  218179        

Community Additions

ADD
Show:
© 2015 Microsoft