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

there is a trigger defined for insert operations on a table, in an oltp system. The trigger is written to instantiate a com object and pass the newly inserted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? : Sql server database administration

1 Answers  


What is the stored procedure?

1 Answers  


What program is used to store the data source file?

1 Answers  


What are the options which must be set to allow the usage of optimistic models?

1 Answers  


What is the best way to move n number of DTS package from one SQLServer to another SQLServer?

1 Answers   RBS,


How to find table changes in sql server?

1 Answers  


Can two tables have the same primary key?

1 Answers  


Describe triggers features and limitations?

1 Answers  


Explain Active/Active and Active/Passive cluster configurations?

1 Answers  


What is the guest user account in sql server? What login is it mapped to it? : sql server security

1 Answers  


Do you know what is a with(nolock)?

1 Answers  


What types of integrity are enforced by a foreign-key constraint

1 Answers  


Categories