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.
| Author |
Topic |
|
juicyapple
Posting Yak Master
176 Posts |
Posted - 2008-02-12 : 22:39:21
|
| How to display all processes associated to a dbname using sp_who? |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2008-02-12 : 23:18:39
|
| you can query sysprocesses.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-12 : 23:32:30
|
| [code]declare @dbname varchar(255)set @dbname = 'TestDB'select spid, ecid, status, loginame=rtrim(loginame), hostname, blk=convert(char(5),blocked), dbname = case when dbid = 0 then null when dbid <> 0 then db_name(dbid) end, cmd from master.dbo.sysprocesses where dbid = db_id(@dbname)[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
juicyapple
Posting Yak Master
176 Posts |
Posted - 2008-02-18 : 02:20:53
|
| Is it possible to filter process id by table name? |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-02-18 : 12:52:09
|
| Then you have to check cmd column, not always work. For instance when process calls a sp that accesses specific table, you'll not see that table name anywhere. |
 |
|
|
|
|
|