LiCongMingDeShujuku / Get-Total-Database-Size-for-All-Databases-On-Server

获取服务器上所有数据库的总数据库大小

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEVER DATA GIT REPO

获取服务器上所有数据库的总数据库大小

Get Total Database Size for All Databases On Server

发布-日期: 2014年05月12日 (评论)

#

Contents

中文

你可以使用此脚本获取以MB,GB和TB组合的所有数据库大小。

English

You can use this script to get ALL the database sizes combined in MB, GB, and TB.


Logic

select
'server' = @@servername
, 'total size in megabytes'= convert(decimal(10,2),(sum(size * 8.00) / 1024.00 ))
, 'total size in gigabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00))
, 'total size in terabytes' = convert(decimal(10,2),(sum(size * 8.00) / 1024.00 / 1024.00 / 1024.00)) from
sys.master_files

WorksEveryTime

Build-Info

Build Quality Build History
Build-Status
Coverage
Nuget
Build history

Author

  • 李聪明的数据库 Lee's Clever Data
  • Mike的数据库宝典 Mikes Database Collection
  • 李聪明的数据库 "Lee Songming"

Gist Twitter Wordpress


License

LicenseCCSA

Lee Songming

About

获取服务器上所有数据库的总数据库大小