Solved

sysprocesses output only for specific database

Posted on 2016-10-06
3
8 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now