08 January,2016 by Tom Collins
Question: How can I get a list of every table in a database, with auxillary information including numbers of rows, data space, index space, percent of database?
I’ve read through the post and sql script on SQL Index Usage - SQL Server DBA but it doesn’t include certain information. Do you have a script returning this table detail?
Answer: A colleague of mine offered this script , which returns the sort of table detail you require. He can’t remember who gave him the script, so thank you to the mystery author.
This script includes returning indexes and metadata per index in the tables. It is very useful particularly if you’re reviewing tables within a database.
I manage SQL Server databases and as part of regular maintenance of the databases, thi s is the sort of information to analyse. It’s not unusual to find tables that are now redundant , these can be offered to the owner , who may decide to drop or archive the table.
Download Tablesize_and_last_user_updates
These sort of tactics assist in streamlining the databases. It will be quicker to run maintenance plans and backup.
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |