Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server.
How SQL server maintains memory usage for tables/indexes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
exec sp_spaceusedwithout parameter shows the summary for the whole database. The foreachtable solution generates one result set per table – which SSMS might not be able to handle if you have too many tables.I created a script which collects the table infos via
sp_spaceusedand displays a summary in a single record set, sorted by size.