Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL Query Problem

Author  Topic 

chetancool
Starting Member

34 Posts

Posted - 2005-04-19 : 06:53:52
Hi Group. This is chetan.

The problem is describe here:

every day, my frontend is quering SQL Server (Orders & trades table) to generate report regarding cumulative order & trade report.
This process takes 1 minute to 1.5 minute.

Today it has taken around 30 minutes to do the same process. Someone suggested to check the table (order & trades) are not locked by other process.

SO please let me know that how can i know that which user is currently logged in?
What are the process relating to that particular user?
If some user has blokced the table so how to release the table.

Help me
.

cjain

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-04-19 : 06:59:06
Run Sp_who at the Query Analyser

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

chetancool
Starting Member

34 Posts

Posted - 2005-04-19 : 08:00:16
i have run that command. Ii has given me result set with 14 records ( of which 12 are system records). can u give me more info on this

cjain
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-04-19 : 10:03:16
Run Profile

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jason
Posting Yak Master

164 Posts

Posted - 2005-04-19 : 17:28:37
Look up sp_who in BOL. There is a wealth of info there. Also, I think madhivanan meant Profiler.

You can try to run this


Use master
select (Select name from sysdatabases where sysdatabases.dbid = sysprocesses.dbid) As DB, waittime,cpu,physical_io,memusage,last_batch,open_tran,status,hostname,program_name,cmd,loginame,net_library,spid
from sysprocesses
order by last_batch DESC


which is the near equivalent to EM current activity. Also, this one will show who's waiting and for what.


SELECT spid, waittime, lastwaittype
FROM master..sysprocesses
WHERE waittime > 1000
Go to Top of Page
   

- Advertisement -