How to show the sizes of all tables in a SQL Server database

SQL-Server

You can use the T-SQL code below to display the size of each table in a specific database.

use MY_DATABASE_NAME
go
EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"
go