How to find out complete byte size of all table in SQL Server Database

--Using this query we can find out complete byte size of All tables in the
--databse
SELECT CASE WHEN (GROUPING(sysObj.name)=1) THEN 'All_Tables'
   ELSE ISNULL(sysObj.name, 'unknown') END AS Table_CompleteName,
   SUM(obj.length) AS Byte_Length
FROM sysobjects sysObj, syscolumns obj
WHERE sysObj.xtype='u' AND obj.id=sysObj.id
GROUP BY sysObj.name
WITH CUBE

--select * from sysobjects
--select * from syscolumns


If you have any queries or suggestions, please feel free to ask in comments section.
Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar