-----code:start------------------------------------------
Declare @Check_TableName Varchar(100)
Declare @Check_Table Table (Table_Name Varchar(100))
Declare @Check_TableSize Table
(
Table_Name Varchar(100),
rows BigInt,
Reserved Varchar(50),
ActualDataSize Varchar(50),
IndexSize Varchar(50),
Unused Varchar(50)
)
Insert Into @Check_Table
Select Table_Name From Information_Schema.Tables
Where Table_Type = 'BASE TABLE'
Select @Check_TableName = Table_Name From @Check_Table
While Exists (Select 1 From @Check_Table)
Begin
Insert Into @Check_TableSize exec sp_spaceused @Check_TableName
Delete From @Check_Table Where Table_Name = @Check_TableName
Select @Check_TableName= Table_Name From @Check_Table
End
Select * From @Check_TableSize Order By rows Desc
Go
-----code:end------------------------------------------
2. Example Results Messages:
Source:
http://www.sqlservercentral.com/scripts/93423/
Article: Find size of all tables in a database
By Suba Sathyanathan