Which column returned by the query represents the free space in each file?

You have the following Transact-SQL query.

Which column returned by the query represents the free space in each file?
A . ColumnA
B . ColumnB
C . ColumnC
D . ColumnD

Answer: C

Explanation:

Example:

Free space for the file in the below query result set will be returned by the FreeSpaceMB column.

SELECT DB_NAME() AS DbName,

name AS FileName,

type_desc,

size/128.0 AS CurrentSizeMB,

size/128.0 – CAST(FILEPROPERTY(name, ‘SpaceUsed’) AS INT)/128.0 AS FreeSpaceMB

FROM sys.database_files

WHERE type IN (0,1);

Reference: https://www.sqlshack.com/how-to-determine-free-space-and-file-size-for-sql-server-databases/

Latest DP-300 Dumps Valid Version with 176 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments