Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sysprocesses output only for specific database

Posted on 2016-10-06
3
Medium Priority
?
29 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

598 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