sTodorov
sTodorov

Reputation: 5461

Show all users trying to connect to SQL server

Is it possible to show all users that are trying to connect to a specific instance of SQL server?

I have a rogue process somewhere and I can't find it. I've also changed the sql password so now the process can't connect to the database but I would still like to stop it.

Thanks!

Upvotes: 1

Views: 1787

Answers (2)

steoleary
steoleary

Reputation: 9298

A quick way to access the error log and filter only failed logins is to run the following query:

EXEC sp_readerrorlog 0, 1, 'Login failed' 

The 0 indicates that you should only search the current log (+1 to this to reference the previous logfile) the 1 indicates that you should look in the SQL Error log and the string is the message to search for.

Upvotes: 1

Bennor McCarthy
Bennor McCarthy

Reputation: 11675

Right click the server in the Object Explorer of SSMS, and select Activity Monitor. Expand the processes section.

That will give you a list of all connections to the database and a view into what they're doing. You can kill a process by right-clicking and selecting "Kill Process".

Upvotes: 0

Related Questions