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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the need for group functions in sql?

745


What is difference between clustered and non clustered index?

702


What is the difference between varchar and nvarchar?

681


Define Business Edition in SQL Azure?

98


How you can find out if an index is useful to the optimizer?

660






Distinguish between commit and rollback?

702


Where is localdb stored?

731


What are the advantages of log shipping?

735


What is Dependency Injection and provide example?

814


Where are SQL server users names and passwords are stored in sql server?

903


What is the difference between clustered and non-clustered indexes in ms sql server?

673


What is analysis service repository?

772


What are the default system databases in sql server 2000?

687


What are different types of statements that are supported by sql?

777


How can I know what locks are running on which resource?

705