Detection and Control of Connected Users in SQL Server

Hello to everyone,

In this article, I will provide information about the detection and control of connected users in SQL Server.

In SQL Server, in some cases, you may want to detect users connected to SQL Server.

You can easily do this using the code below.

SELECT program_name,
       SUBSTRING(CONVERT(NVARCHAR, MAX(login_time)), LEN(CONVERT(NVARCHAR, MAX(login_time))) - 6, 8)
FROM master.dbo.sysprocesses
GROUP BY program_name;

When you run the above code, you will get a result similar to the one below.

Detection and Control of Connected Users in SQL Server

As you can see, we have detected users connected to SQL Server.

I also connected to SQL Server with HeidiSQL as an example. It appears in the photo.

Good luck to everyone in business and life.

300 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!