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



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

SELECT @@CONNECTIONS AS [Total Connections]

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

SELECT @@CONNECTIONS AS [Total Log In Attempts],
	GETDATE() AS [As of Today]
Using GETDATE() and @@CONNECTIONS Example 2

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.