Multiple choice technology web technology

select stuff('abcdef',3,2,'YZ')

  1. abcYZef

  2. abYZef

  3. aYZdef

  4. abYZcdef

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The STUFF function in SQL Server replaces a portion of a string with another string. The syntax is STUFF(original_string, start_position, length, replacement_string). Starting at position 3 (the character 'c'), it replaces 2 characters ('cd') with 'YZ', resulting in 'abYZef'. Option A is incorrect because it keeps 'c' before YZ. Option C incorrectly starts replacement from position 2. Option D incorrectly preserves all original characters.