SQL @@CONNECTIONS

SQL @@CONNECTIONS Statistical Function returns the number of connections since the last time SQL server started. It includes both successful and unsuccessful connections. The syntax behind this is @@CONNECTION is

@@CONNECTIONS

SQL @@CONNECTIONS Example

The below code snippet will show you the total number of connections for this SQL Server.

-- SQL Server @@CONNECTIONS Example
SELECT @@CONNECTIONS AS [Total Connections]
SQL @@CONNECTIONS Example 1

You can use the GETDATE() function along with this function to see the total number of connections until today.

-- SQL Server @@CONNECTIONS Example
SELECT @@CONNECTIONS AS [Total Log In Attempts],
	GETDATE() AS [As of Today]
SQL @@CONNECTIONS Example 2