且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在SQL Azure中找到最大数据库空间和使用的数据库空间?

更新时间:2022-11-26 12:22:51

您可以通过动态管理视图计算已用空间(参考页 here ):

You can calculate used space via dynamic management views (reference page here):

SELECT SUM(reserved_page_count)*8.0/1024
FROM sys.dm_db_partition_stats; 

虽然我不认为你可以检索最大尺寸,数据库到最大的大小,因为你只需要为你使用的空间开帐单。话虽如此:如果你只是在5GB以下的范围内,***去使用Web版。如果您已经达到10 GB以上,则不应该有任何危害,最大大小设置为150 GB,然后监控消耗的大小。

While I don't think you can retrieve max size, it doesn't hurt to simply set your database to the largest size, since you're only billed for space you use. Having said that: If you're only in the sub-5GB range, it's best to go with Web edition. If you're already at 10+ GB, there shouldn't be any harm setting max size to 150GB and then monitoring consumed size.