70-464 Exam QuestionsBrowse all questions from this exam

70-464 Exam - Question 43


You have a Microsoft Azure SQL Database instance.

The database contains a disk-based table named ContentTable that has 1 million rows and a column named Fax. Fax allows null values.

You need to update Fax to meet the following requirements:

✑ Prevent null values from being used.

✑ Always use an empty string instead of a null value.

Which statement or statements should you execute? (Each correct answer presents part of the solution. Choose all that apply.)

Exam 70-464 Question 43
Show Answer
Correct Answer: AE

To ensure that null values are not allowed and that an empty string is used instead, you should first update all existing null values to an empty string. This can be done with the statement to set Fax = '' where Fax is null. Next, you should add a default constraint to set future inserts to an empty string if no value is provided. Thus, options A and E are correct. Option B is not appropriate here because altering the column to add the NOT NULL constraint directly will fail if current null values exist, and we already handled nulls and defaults with options A and E.

Discussion

1 comment
Sign in to comment
Kepty
Nov 23, 2020

Answers are correct, but the explanation is a bit wrong - you need to set NOT NULL first, then set default value

LiamLin
Aug 29, 2021

Should be DEFAULT FIRST to prevent new record will not null UPDATE EMPTY NOT NULL