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 would you improve etl (extract, transform, load) throughput?

0 Answers   LinkedIn,


what are user defined datatypes and when you should go for them? : Sql server database administration

0 Answers  


Find top Nth employee from each department in terms of salary?

13 Answers   RealPage,


Difeerence between ssis 2005 and ssis2008?

1 Answers   Convergys,


Will sql server 2005 allow you to reduce the size of a column?

0 Answers  






Is it possible to allow NULL values in foreign key? I s it possible to use different constraints for the same column in the table (i.e) (id int NOT NULL,UNIQUEUE)

1 Answers  


How we can refresh the view?

0 Answers  


How to use group functions in the select clause in ms sql server?

0 Answers  


What is inline table-value user-defined function?

0 Answers  


Explain in brief how sql server enhances scalability of the database system?

0 Answers  


Where is SQL Srever (In sQL server 2005/2008 where is SQL Server Located).

2 Answers   TCS,


plz tell me the new features of sqlserver2000,sqlserver2002,sqlserver2005

3 Answers  


Categories