MSSQL administration

MSSQL administration

Summary:
Need a way to get a summary dashboard view of various table stats in MSSQL.

Details:
For example comparing against - MySql + phpmyadmin -
gives a nice overview of database stats.
For each table - rowcounts, bytes, etc.
What is a good way to get similar dashboard stats for MSSQL database?
I found sp_databases and sp_help
I was going to start wrinting something to pull stuff from dbo.sysobjects,
but I believe there may be solutions out there already.

Looking for good advice.
LVL 1
weinerkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SashPCommented:
Hi weinerk

sp_spaceused [table name]

will give you the results that that you are looking for

Cheers Sash
0
SashPCommented:
weinerk,

By definition, sp_spaceused only accepts a single object as a parameter.But in this case you can use the undocumented call sp_MSforeachtable as in:
EXEC sp_MSforeachtable 'sp_spaceused ''?'''
Or an alternative approach would be to write a cursor to loop through the number of tables and execute the sp_spaceused against each.

You can also store the info in a table for later analysis as illustrated in this example...

CREATE TABLE #TemptableforspaceUsed
(name SYSNAME,
rows INT,
reserved VARCHAR(10),
data VARCHAR(10),
index_size VARCHAR(10),
unused VARCHAR(10))
 
INSERT #TemptableforspaceUsed
EXEC sp_MSforeachtable 'sp_spaceused ''?'''

select * from #TemptableforspaceUsed
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
weinerkAuthor Commented:
Thanks, once I got that I found this:
http://www.tkdinesh.com/faq/ans/spsumult.html

Q:Can the stored procedure sp_spaceused be used on multiple tables at a time?

A:By definition, sp_spaceused only accepts a single object as a parameter.But in this case you can use the undocumented call sp_MSforeachtable as in:
EXEC sp_MSforeachtable 'sp_spaceused ''?'''
Or an alternative approach would be to write a cursor to loop through the number of tables and execute the sp_spaceused against each.

You can also store the info.in a table for later analysis as illustrated in this example...

CREATE TABLE #TemptableforspaceUsed
(name SYSNAME,
rows INT,
reserved VARCHAR(10),
data VARCHAR(10),
index_size VARCHAR(10),
unused VARCHAR(10))
GO
INSERT #TemptableforspaceUsed
EXEC sp_MSforeachtable 'sp_spaceused ''?'''

0
weinerkAuthor Commented:
Funny I found the same page :-)))))
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.