Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does SQL Server view all table sizes

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you SQL Server how to check all the table sizes, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. View all database-related information, package storage path, etc.

Use master

Select * from dbo.sysdatabases

two。

Take SQL2000 with PUBS as an example

Exec sp_MSForEachTable

@ precommand=N'create table # #

Table name sysname

Number of records int

Reserved space Nvarchar (10)

Use Space varchar (10)

Index usage space varchar (10)

Unused space varchar (10)'

@ command1=N'insert # # exec sp_spaceused'?''

@ postcommand=N'select * from # number of order by records'

Table name, number of records, reserve space, use space index, use space unused space.

PersonalTabs 57011 11208 KB 3280 KB 7728 KB 200 KB

Roles 8 32 KB 8 KB 24 KB 0 KB

GradeTotal 307 32 KB 16 KB 16 KB 0 KB

ChildSlaveTableDtl 0 8 KB 0 KB 8 KB 0 KB

SMSPersonalAcount 1 16 KB 8 KB 8 KB 0 KB

SelectData 169 136 KB 64 KB 16 KB 56 KB

MainTable_Class 7 16 KB 8 KB 8 KB 0 KB

The above is all the content of the article "how to view all table sizes in SQL Server". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report