How to calculate the used database space in SQL Azure?

0 votes

I found in the documentation that In SQL Azure each database has a size limitation. In order for my service to not suddenly come to a halt I'd like to be able to programmatically find the current maximum size and current actually used space

So, How do I find the current maximum allowed size and current actually used space in a SQL Azure database?

Mar 5, 2019 in Azure by datageek
• 3,050 points
129 views

1 answer to this question.

0 votes

I don't think its possible to find maximum allowed space. But you can calculate used space via dynamic management views:

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

Hope this helped!

answered Mar 5, 2019 by Archana
• 5,600 points

Related Questions In Azure

0 votes
1 answer

How to query between databases in SQL Azure Database Server?

SQL Azure supports cross database queries: https://azure.micro ...READ MORE

answered Apr 9, 2019 in Azure by p
• 1,960 points
3,637 views
0 votes
1 answer

How to create table in Azure SQL Database?

Creating tables in Azure SQL Database: In Object Explorer, ...READ MORE

answered Jan 22 in Azure by Sirajul
• 58,130 points
4,200 views
+1 vote
10 answers

How can the NuGet packages be used in Azure Functions?

Yes! Although the Azure Functions portal does ...READ MORE

answered Jun 8, 2018 in Azure by club_seesharp
• 3,450 points
9,759 views
0 votes
1 answer

How to determine the number of messages in an Azure Services Bus Queue?

You will get error when you try ...READ MORE

answered Jun 12, 2018 in Azure by null_void
• 3,220 points
1,725 views
0 votes
1 answer

How to identify a deadlock in SQL Azure?

Monitoring of SQL Azure is more limited ...READ MORE

answered Jun 19, 2018 in Azure by club_seesharp
• 3,450 points
971 views
0 votes
4 answers

How can I rename a SQL Azure database?

This command serves the purpose ALTER DATABASE [oldname] ...READ MORE

answered Nov 30, 2018 in Azure by Abhinav
846 views
0 votes
1 answer

Azure Table or SQL Azure for storing app data.

Azure tables are cheaper, simpler and scale ...READ MORE

answered Jul 8, 2019 in Azure by Perry
• 17,100 points
114 views
0 votes
1 answer

What is Azure SQL database? How to connect to Azure SQL database?

Azure SQL Database is a general-purpose relational ...READ MORE

answered Jan 13 in Azure by Sirajul
• 58,130 points
304 views
0 votes
1 answer

What is sql azure?

SQL Azure is Microsoft’s cloud database service. Based ...READ MORE

answered Jan 20 in Azure by Sirajul
• 58,130 points
134 views
0 votes
1 answer

Which is better: Azure Blob or Azure Table?

The best solution is blob storage with ...READ MORE

answered Mar 5, 2019 in Azure by Archana
• 5,600 points
79 views