Solved

sysprocesses output only for specific database

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Microsoft is moving in-place eDiscovery & hold from ECP to EOP console under Content Search in Search and Investigation Options.  In this post, I will be showing you how to export emails to a PST file using the Content Search Options.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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