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

How to invoke a trigger on demand?

0 Answers  


What does truncate do?

0 Answers  


what is hash table

3 Answers   ILFS, Teledata,


What is the sql server 2000 version number?

0 Answers  


What is 2nf normalization?

0 Answers  






can a database be shrunk to 0 bytes, if not, why? : Sql server administration

0 Answers  


what's the difference between a primary key and a unique key? : Sql server database administration

0 Answers  


How to create database with physical files specified in ms sql server?

0 Answers  


What are triggers? How do you invoke a trigger on demand?

0 Answers   Hexaware,


Tell me what is log shipping?

0 Answers  


i have account table which consists of account name,card no and card no consists 16 digits now i want to retrieve the data if card no starts from 4 then it should print visa and if it starts from 5 then it should print master so plse help me to write simple query with out store procs .

3 Answers  


Explain various data region available in ssrs with their use?

0 Answers  


Categories