SQL table size

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

SQL table size

Post by Kris »

Hi all,

I'm trying to create a test that monitors the size of a specific table in MS SQL server...
Thus far I've been fiddling with the ODBC test, but no luck yet...

Could anyone point me in the right direction?

Thanks!
Kris
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

This may depend on version of your MS SQL server.
Have you trid query like

SELECT ROUND(data_length/1024/1024,2) total_size_mb FROM information_schema.tables WHERE table_name = 'table_name' AND table_schema = 'database_name'

Also there is sp_spaceused stored procedure
http://msdn.microsoft.com/en-us/library ... 90%29.aspx

Regards
Alex
Kris
Posts: 375
Joined: Wed May 12, 2010 3:22 am

Post by Kris »

We ended up querying a stored procedure that returns the table size.

Thanks for pointing that out!
Post Reply