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

x
?
Solved

MySQL SHOW STATUS equivalent in MSSQL

Posted on 2004-04-28
9
Medium Priority
?
662 Views
Last Modified: 2008-02-01
Hi,
I am looking for an equivalent query that will give me similar results to the MySQL "SHOW STATUS" query.
Thanks!
0
Comment
Question by:shji1
[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
  • 5
  • 4
9 Comments
 
LVL 6

Expert Comment

by:robertjbarker
ID: 10946604
exec sp_monitor might be a start.

I think you will have to look up individual things more than in MySQL.  Looks like MySQL is a little more organized in this area.

Are you looking for something in particular?  Best thing might be to get into the on-line help and search for the particular property you are interested in.
0
 
LVL 1

Author Comment

by:shji1
ID: 10946639
I need to get more data about the server-status.
MySQL gives me plenty of it, and I am trying to get something similar.
For example, Iwould like to get the Bytes_sent, Bytes_received, # of questions, memory usage, threads etc.
thanks
0
 
LVL 1

Author Comment

by:shji1
ID: 10946680
I've found the 'EXEC sp_helpdb' which is closer to my intentions, but I need more...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Accepted Solution

by:
robertjbarker earned 200 total points
ID: 10946758
exec sp_monitor has packets_received, packets_sent, packet_errors, total_read, total_write, total_errors, and connections.  These are not exactly, but are close to many of the things you seek.
0
 
LVL 1

Author Comment

by:shji1
ID: 10946833
Well, I tried it, but I only got 'last_run', 'current_run' and 'seconds' - One row only.
Are you sure it's sp_monitor?
I simply typed exec sp_monitor and this is what I got.
0
 
LVL 1

Author Comment

by:shji1
ID: 10946858
And another thing...  Only a System Administrator can execute the sp_monitor, and I can't limit my application to admin only.

0
 
LVL 1

Author Comment

by:shji1
ID: 10946895
By the way, I am using JDBC to query the database, and the sp_monitor returns a multiple ResultSets. That is the reason I could not see the rest of the results (only the first).
0
 
LVL 6

Expert Comment

by:robertjbarker
ID: 10955505
The sp_monitor returns four different results sets.  If you execute in query analyzer you will see this.  I would imagine accessing the results depends on the method you are using to communicate with SQL Server.  If you search for sp_monitor, or "multiple result sets", or something like you will get a few results including:

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20383209.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20165270.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20373521.html

jdbc is not specifically addressed, but you might get something out of it...
0
 
LVL 6

Expert Comment

by:robertjbarker
ID: 10955691
Also, you might be able to wrap sp_monitor in another stored procedure and give that procedure permission to execute sp_monitor.

Or you can consider just consider granting sp_monitor execute permissions to your users.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

609 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