Friday, May 15, 2009

Space Used by Database and Table SQL Server Command

How to know how much space is consumed by your database.
Exec sp_spaceused 

Output
database_name    database_size      unallocated space
------------------------------------------------ ---
Northwind             58.38 MB           8.23 MB

reserved           data               index_size         unused
------------------ ------------------ --------------
12056 KB           10464 KB           1104 KB            488 KB




How to know how much space is consumed by each table in your database
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"

Well i cannot display output information but you can certainly try it SQL Analyzer and see the useful information about your database to control its size and remove unnecessary data.

No comments:

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape