Wednesday, September 19, 2012

SQL Server: check all tables disk space

Table ไหน ใช้พื้นที่เยอะสุด?

คำสั่ง SQL ในการดูว่าแต่ละ Table มีกี่รายการ และใช้เนื้อที่ดิสก์ไปเท่าไหร่

EXEC sp_MSforeachtable @command1="EXEC sp_spaceused '?'"