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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is subquery? Explain the properties of a subquery?

507


How to change the ownership of a schema in ms sql server?

558


How do clustered indexes store data?

612


What is after dml trigger?

570


What is sql server profiler trace data file?

581






how can a database be repaired? : Sql server administration

514


What are the recovery models in sql server 2000?

556


How to get a list of columns using the "sys.columns" view in ms sql server?

556


Do you know what is difference between index seek vs. Index scan?

515


What is save transaction and save point?

622


Can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible?

613


How to stop log file growing too big?

573


How many servers can we create in a single subscription?

146


What methods do you follow to protect from sql injection attack?

514


When does a workload on SQL Azure get throttled?

113