We can identify each table wise memory allocation in a Database using Sp_SpaceUsed.
Create Table #TableAllocation
(
[Table Name] Varchar(100),
Records Varchar(10),
Reserved Varchar(10),
Data Varchar(10),
[Index Size] Varchar(10),
UnUsed Varchar(10)
)
Insert #TableAllocation
Exec('Sp_MSForEachTable ''Sp_SpaceUsed ''''?''''''')
Go
Select * from #TableAllocation
Go
Drop Table #TableAllocation
Go
Create Table #TableAllocation
(
[Table Name] Varchar(100),
Records Varchar(10),
Reserved Varchar(10),
Data Varchar(10),
[Index Size] Varchar(10),
UnUsed Varchar(10)
)
Insert #TableAllocation
Exec('Sp_MSForEachTable ''Sp_SpaceUsed ''''?''''''')
Go
Select * from #TableAllocation
Go
Drop Table #TableAllocation
Go
Result:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg22cHo2UsSNY41k0_SAxvLOX3e0utOJ6M00l5KHkJW8VBGzgOITUY4pqUAU8a6ncFr1nKnXgwRwEzwdEkrl1Vmy6cz9jTgQtgTCe6Uqgzu82h6LYM61e5AxKL3tfi2pVwJFFSLufop8c3g/s400/Result.bmp)
Good goin maan... Congrats....
ReplyDelete