How can I know what query is executing by by a particural
user? (using sp id or any othe way.)

Answers were Sorted based on User's Feedback



How can I know what query is executing by by a particural user? (using sp id or any othe way.)..

Answer / suvendu

SELECT *
FROM Master.dbo.sysprocesses
WHERE DBID NOT IN (1,2,3,4) -- Master, Tempdb, Model, MSDB
AND spid > 50
ORDER BY spid DESC

Is This Answer Correct ?    2 Yes 0 No

How can I know what query is executing by by a particural user? (using sp id or any othe way.)..

Answer / prem

DBCC INputbuffer(spid)- Displays the last statement sent
from a client to an instance of Microsoft SQL Server 2005.

First 256 characters only will be displayed.


SQL statements can also be captured by running a profiler.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More SQL Server Interview Questions

plss anybody specify tha constrian management system in dbms

0 Answers   Police Constable,


what are different types of backups available in sql server? : Sql server database administration

0 Answers  


What are window functions in sql server?

0 Answers  


How to include date and time values in sql statements?

0 Answers  


How to write a query with a right outer join in ms sql server?

0 Answers  






What is row_number function?

0 Answers  


What is the maximum length of an alert name?

0 Answers  


What is msdb database? : SQL Server Architecture

0 Answers  


What is a filestream?

0 Answers  


What is order of B+tree?

0 Answers   HCL,


How many types of Outer Joins?What are they?

1 Answers  


What is transaction server distributed transaction?

0 Answers  


Categories