

For compliance legal reasons, depending on the business area, the data might need to be kept and backed-up more years.Understand the layout of the DB Browser for SQLite and the key facilities that it provides To fix this it’s mandatory to schedule maintenance scripts to clean the log tables and regularly delete the obsolete data, like for example a 5 years rolling period to keep on line. Indeed any database grows, because the log grows, the data grows, the log file grows, the backup file grows, etc. The disk space usage in SQL Server is a classical maintenance topic For instance if a table have not been access over the last three years, it might not be necessary anymore. For example because the server hard drive is getting full, then this query allows you to know the last time a table was accessed or updated.
SQL TABS LIST OF ALL TABLES FREE
To go further, usually the goal is to check and free up space in a database. (sum(alc.total_pages) - sum(alc.used_pages)) * 8 as UnusedSpace Use sys.tables, sys.indexes, sys.partitions, sys.allocation_units and sys.schemas to display the line number, and also the size of the tables. It displays the schema name, table name, row counts and space (total, used and unused space) for each table in the SQL Server database.

This third query is using different system tables, namely sys.tables, sys.indexes, sys.partitions, sys.allocation_units and sys.schemas. Get the list of all table from SQL Server database with row count and used space per table Second query to list tables uses the sys.tables system tablesģ. Use the information_schema.tables system table. This first approach solution uses the data stored in information_schema schema about the tables. First query to list all SQL Server tables using the information_schema.tables system tables

SQL TABS LIST OF ALL TABLES HOW TO
How to list tables and disk space in SQL Server ?Ĭheck our these three SQL queries to display the list of SQL Server tables: The third solution shows the number of lines for every table. Three different ways, but similar are presented here to display SQL Server tables and disk space used by each table. List tables and disk space in SQL Server database can be very convenient especially to analyze the disk usage and the free disk space used by each table.
