exam questions

Exam DP-300 All Questions

View all questions & answers for the DP-300 exam

Exam DP-300 topic 7 question 13 discussion

Actual exam question from Microsoft's DP-300
Question #: 13
Topic #: 7
[All DP-300 Questions]

HOTSPOT -
You have an Azure SQL database named DB1.
You need to identify how much unused space in megabytes was allocated to DB1.
How should you complete the Transact-SQL query? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: 128.0 -
-- Connect to database
-- Database data space allocated in MB and database data space allocated unused in MB
SELECT SUM(size/128.0) AS DatabaseDataSpaceAllocatedInMB,
SUM(size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0) AS DatabaseDataSpaceAllocatedUnusedInMB

FROM sys.database_files -

GROUP BY type_desc -
HAVING type_desc = 'ROWS'

Box 2: sys.database_files -
Reference:
https://techcommunity.microsoft.com/t5/azure-database-support-blog/how-to-get-azure-sql-database-size/ba-p/369189

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
wyindualizer
6 months, 3 weeks ago
Correct https://learn.microsoft.com/en-us/azure/azure-sql/database/file-space-manage?view=azuresql
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...