sql query to find the table size mssql

Solutions on MaxInterview for sql query to find the table size mssql by the best coders in the world

showing results for - "sql query to find the table size mssql"
Theo
30 Feb 2016
1USE [YourDBName] -- replace your dbname
2GO
3SELECT
4s.Name AS SchemaName,
5t.Name AS TableName,
6p.rows AS RowCounts,
7CAST(ROUND((SUM(a.used_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Used_MB,
8CAST(ROUND((SUM(a.total_pages) - SUM(a.used_pages)) / 128.00, 2) AS NUMERIC(36, 2)) AS Unused_MB,
9CAST(ROUND((SUM(a.total_pages) / 128.00), 2) AS NUMERIC(36, 2)) AS Total_MB
10FROM sys.tables t
11INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id
12INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
13INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id
14INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
15GROUP BY t.Name, s.Name, p.Rows
16ORDER BY s.Name, t.Name
17GO
18
queries leading to this page
how to get table size in sql serversql table size in mbsize of sql table querysql get table sizessql get table size in bytessql query for table sizetable size in sql servertsql table sizehow to check table size in sql serverto find the table size in sql serversql server table sizes querysql server query to get the size of all tables in a databasesql query to get table sizetsql calculate table sizesget size of table in sql serversql query get table sizeselect table size sql servertsql select table sizeget sql table sizehow to check table size in sql server using queryfind size of table in sql serverhow to get table size sql serverquery for check size of item from databasesql server show trables sizesshow all table and the length in sqlsee the size of a sql server tablesql query table size in databasesql server query size of tablesmssql table sizesshow size of table ms sqlcheck table size ins sqlsql server table size reportsql size of tables in databaselist of tables with size in sql servercheck size of a table in mssqlsql server get dimension of each table mssql see size of tablesget table size sql serversql server database table size querysql tables sizesql query show table sizehow to know size of table in sql serversql data table size queryget size of each table in sql server databasesql table size queryms sql database table size queryms sql table size querytsql select file size of the tablesql server get size of all tablessql get tables sizeget table size in sql serverget size of table ms sqlsmsql check table data size in mbsql how to get table data sizehow to display table in sql sizesql server how to find table sizeget sql table sizesmssql table sizequery to get all table size in sql serversql get table sizetable size sqlhow to check the table size in sql serverget table size sqllist size of all tables in sql serverhow to check database table size in sql serverselect all table names sql server count lengthsql server query to show table sizemssql command to get tables sizessql server get size of tablessql server check each table sizesql table sizesql server script to find size of all tables in databaselist tables in sizes and sql serverhow to now the number of bitts that a tble tables in sqlt sql list size of tablesms sql size of tablemssql get size of tabletables size in sql serverfind sql table sizesql query to find the table size mssql