In a stored-proc. I’m studying, I keep seeing lines like this:
IF @IsSupplierUser = 0
SET @SQL += CHAR(13) + CHAR(9) + N' ,cs.FEDSurveyName as ''Complete Survey Name'''
What is the purpose of putting tabs/carriage-returns when SQL by default will just put out a standard table of cells anyway? Isn’t the output already a CSV file by default?
Am I missing something really obvious?
thanks
It looks like the stored procedure is using dynamic SQL, and perhaps the person that originally wrote it was potentially doing this for ease of readability. There might even be a commented out (or not) statement that does
PRINT(@SQL).Other than that from the short snippet there, I see no reason to put the spaces/new line in there.