SET NOCOUNT ON
DBCC UPDATEUSAGE(0)
-- DB size.
EXEC sp_spaceused
-- Table row counts and sizes.
CREATE TABLE #t
(
[name] NVARCHAR(128),
[rows] CHAR(11),
reserved VARCHAR(18),
data VARCHAR(18),
index_size VARCHAR(18),
unused VARCHAR(18)
)
INSERT #t EXEC sp_msForEachTable 'EXEC sp_spaceused ''?'''
SELECT *
FROM #t
-- # of rows.
SELECT SUM(CAST([rows] AS int)) AS [rows]
FROM #t
DROP TABLE #t
Reference : http://therightstuff.de/CommentView,guid,df930155-f60f-4f56-ab33-f1352ff091a1.aspx
Wednesday, December 11, 2013
How To Obtain The Size Of All Tables In A SQL Server Database
Subscribe to:
Comments (Atom)
MS CRM 2011 KB Article customization Issue.
Recently I have encountered some issue while customizing Kb Article Entity. I was doing following configuration in Article form. 1. Add Ba...
-
Recently I wanted to find out users who are not in the correct time zone in CRM System. To change the time zone or user related settings we ...
-
If you want to take part in the internet as a business, information resource, directory, or as a hobbyist wanting to share data, informatio...
-
Do you need to recover lost files, photos or documents? You're sure that a file was on your hard disk some time ago, but now it seems to...