sysprocesses output only for specific database

hi

sysprocesses output in sybase doesnt give database name as sp_who does. how can i get sysprocesses output only for specific database

thanks
rsvijayAsked:
Who is Participating?
 
Joe WoodhouseConnect With a Mentor Principal ConsultantCommented:
Do you want to see sysprocesses for a single database? It's easy to query the table directly:

select [whatever columns]
from master..sysprocesses
where dbid = db_id("[your database]")
go

Open in new window


But if you mean you'd like exactly the same output as sp_who but only for a given database, you'll want to write your own procedure. Take a look at sp_who in sybsystemprocs by running

use sybsystemprocs
go
exec sp_helptext sp_who
go

Open in new window


If you copy that code and rename the proc, you could add a new parameter and a WHERE clause as above.

(I see from your profile you're not accepting suggestions for Gigs else I could do this for you. :) )
0
 
rsvijayAuthor Commented:
500
0
 
rsvijayAuthor Commented:
Hi Joe,

thanks for your help.
i am able to solve my problem with your suggesstions.

thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.