devxlogo

November 19, 2009

Retrieving Table Size in SQL Server

The following SQL query returns the size of each table in the specified database. USE sp_MSforeachtable @command1=’EXEC sp_spaceused ”?”’,@whereand=’or OBJECTPROPERTY(o.id, N”IsSystemTable”) = 1′ Here’s how it works. SQL Server’s system