RE: How to find out the biggest table by size in a database?
Here is a little different twist on your request. -- Create the temp table for further querying CREATE TABLE #temp( ServerName varchar(30), DBName varchar(40), rec_id int IDENTITY (1, 1), table_name varchar(128), nbr_of_rows int, data_space decimal(15,2), index_space decimal(15,2), total_size decimal(15,2), percent_of_db decimal(15,12), db_size decimal(15,2))-- Get all tables, names, and sizes EXEC sp_msforeachtable @command1="insert into #temp(nbr_of_rows, data_space, index_space) exec sp_mstablespace '?'", @command2="update #temp set table_name = '?' […]
2005-04-25