Hi,
How do we find out the login names from the o/p of sp_who2 when there are multiple queries are being exe
Technology Tips and News
Hi,
How do we find out the login names from the o/p of sp_who2 when there are multiple queries are being exe
I am not exeactly sure what you are asking, loginname is part of the output of sp_who2.
If you are looking for only distinct loginnames from sp_who2 you can store the output of sp_who2 into a temp table and them do a select distinct loginname from <temptable>
If you are on SQL2005 and newer ( which i hope you are) you can also just use DMV to get the same information you are looking for, something like this:
select distinct s.login_name from sys.dm_exec_requests r join sys.dm_Exec_sessions s on r.session_id = s.session_id where r.session_id>50
Hi Arun,
When you issue sp_who2 the result will display the log in information.
In here login means the user established connection with the database.
This log in establishes connection between database and application.
i hope this helps.
thanks
kumar