What will be the output of the below TSQL Script?

DECLARE @String VARCHAR(MAX)
SET @String = 'DNF'

;WITH numberCTE AS
(
SELECT 1 AS Rn
UNION ALL
SELECT Rn+1 FROM numberCTE WHERE Rn<LEN(@String)
)
SELECT Characters = SUBSTRING(@String,rn,1)
FROM numberCTE

 Posted by Rajnilari2015 on 3/14/2017 | Category: Sql Server Interview questions | Views: 4075 | Points: 40
Select from following answers:
  1. String DNF will be split into individual characters like D N F row wise
  2. String DNF will be split into individual characters like D N F column wise
  3. Only DN will appear
  4. Only NF will appear
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response