July 15, 2008 at 2:29 pm
Hi,
I have binary executable that is executing queries against my database. I am trying to get a list of queries being sent by this binary to my SQL server. Does anybody have any recommendations on how to go about it?
Thanks,
Mo
July 15, 2008 at 2:41 pm
you can run a profiler and check for hostname,application name etc
Or
select qs.SPID,user_name(qs.spid),qs.BLOCKED,qs.WAITTYPE,qs.DBID,qs.CPU,qs.PHYSICAL_IO,
qs.LOGIN_TIME,
qs.LAST_BATCH,
qs.STATUS,
qs.HOSTNAME,PROGRAM_NAME,
qs.HOSTPROCESS,CMD,
qs.NT_DOMAIN,
qs.NT_USERNAME,
qs.NET_LIBRARY,
qs.LOGINAME,object_name(ec.objectid,qs.dbid) as objectid,ec.text as SQLTEXT
from master.sys.sysprocesses AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) ec
Maninder
www.dbanation.com
July 16, 2008 at 1:25 am
Please don't cross post.
Also asked (and answered) here:
http://www.sqlservercentral.com/Forums/Topic534754-1291-1.aspx
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply