What will be the output of the below TSQL Script?

DECLARE @Data VARCHAR(MAX)
SET @Data = 'hello!DNF.'


;WITH numberCTE AS
(
SELECT 1 AS Rn
UNION ALL
SELECT Rn+1 FROM numberCTE WHERE Rn<LEN(@Data)
)
SELECT [Serial Number] = Rn
FROM numberCTE

 Posted by Rajnilari2015 on 3/14/2017 | Category: Sql Server Interview questions | Views: 3501 | Points: 40
Select from following answers:
  1. Range of numbers from 1 to 10
  2. Range of numbers from 0 to 10
  3. Range of numbers from 1 to 11
  4. Range of numbers from 0 to 11
  5. All Above

Show Correct Answer


| Alert Moderator 

Comments or Responses

Login to post response