CSDN博客

img rickielee

Monitor sql connection from .Net SqlClient Data Provider

发表于2004/7/14 9:27:00  707人阅读

You can use the following sql script to monitor sql server processes and connections, whose function is almost the same as SP_Who &  SP_Who2.

Select spid, uid=RTrim(loginame), program_name=RTrim(program_name),
dbname
=db_name(dbid), status=RTrim(status) 
From master.dbo.sysprocesses
Where loginame='sa or other login name' and db_name(dbid)='database name' 
 
AND program_name='.Net SqlClient Data Provider'

eg.
Select spid, uid=RTrim(loginame), program_name=RTrim(program_name),
dbname
=db_name(dbid), status=RTrim(status) 
From master.dbo.sysprocesses
Where loginame='sa' and db_name(dbid)='HRIS2004' 
 
AND program_name='.Net SqlClient Data Provider'
0 0

相关博文

我的热门文章

img
取 消
img