sp_spaceused - How to measure the size in GB in all the tables in SQL

后端 未结 4 1248
离开以前
离开以前 2021-02-09 01:18

Following the discussion in How to measure table size in GB in a table in SQL, I\'m looking for a solution to measure the space used by all the tables of a SQL Server individual

4条回答
  •  情深已故
    2021-02-09 01:44

    I'm assuming your trying to use sp_spaceused to find the size for ALL tables in a db?

    If so, you can do this:

    USE database_name
    GO
    sp_msforeachtable 'exec sp_spaceused [?]'
    

提交回复
热议问题