ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 40 - DP-300 discussion

Report
Export

You have the following Transact-SQL query.

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

A.
ColumnA
Answers
A.
ColumnA
B.
ColumnB
Answers
B.
ColumnB
C.
ColumnC
Answers
C.
ColumnC
D.
ColumnD
Answers
D.
ColumnD
Suggested 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/

asked 02/10/2024
lawrence Ajibolade
49 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first