By executing below SQL Query, you will get the list of connected users with the last running SQL Statement by each user...
Who is connected
---------------------
CREATE TABLE #WHO_TEST(
[spid] [int] NULL,
[ecid] [int] NULL,
[status] [nvarchar](50) NULL,
[loginame] [nvarchar](50) NULL,
[hostname] [nvarchar](500) NULL,
[blk] [nvarchar](50) NULL,
[dbname] [nvarchar](500) NULL,
[cmd] [nvarchar](500) NULL,
[request_id] [int] NULL
)
insert into #WHO_TEST
EXEC sp_who;
SELECT *,(SELECT TEXT FROM sys.dm_exec_sql_text((select sql_handle FROM sys.sysprocesses WHERE spid = a.spid))) SQL_CMD
from #WHO_TEST a
Drop Table #WHO_TEST
Nothing Is Bug …: Who Is Connected And Executing What In Sql Server >>>>> Download Now
ReplyDelete>>>>> Download Full
Nothing Is Bug …: Who Is Connected And Executing What In Sql Server >>>>> Download LINK
>>>>> Download Now
Nothing Is Bug …: Who Is Connected And Executing What In Sql Server >>>>> Download Full
>>>>> Download LINK