Solved

sysprocesses output only for specific database

Posted on 2016-10-06
3
9 Views
Last Modified: 2016-10-07
hi

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

thanks
0
Comment
Question by:rsvijay
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 500 total points
ID: 41833964
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
 

Author Closing Comment

by:rsvijay
ID: 41834014
500
0
 

Author Comment

by:rsvijay
ID: 41834018
Hi Joe,

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

thanks
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Adding Computers to AD groups through an SCCM Task Sequence
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question