<p>Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server.</p>

<p>How SQL server maintains memory usage for  tables/indexes?</p>

```
```
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"
```
```