script for checking process by session user

Hello,

I search a script for checking process by session user.

Thanks

Regards

bibi
bibi92Asked:
Who is Participating?
 
Daniel_PLDB Expert/ArchitectCommented:
Which SQL Server does it concern? What exactly do you want to know?
For SQL Server 2000 you have sys.sysprocesses dynamic view (it exists in newer versions, for compatibility purposes only)
For SQL Server 2005 and up you have three system views:
sys.dm_exec_sessions
sys.dm_exec_connections
sys.dm_exec_requests



--SQL 2005 and higher
select * from sys.dm_exec_sessions
select * from sys.dm_exec_connections
select * from sys.dm_exec_requests

--SQL 2000
select * from sys.sysprocesses

Open in new window

0
 
bibi92Author Commented:
Thanks bibi
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.