• Actually, both are part of formatting the output (when printing the SQL) that do not affect the actual executed dynamic SQL.

    However, I usually do this a little differently. First of all, I use CRLF and not just LF: CHAR(13) + CHAR(10)

    Also, I assign these to a variable early in the procedure to prevent mistakes and from having to type them repeatedly, as shown here:

    DECLARE @CRLF char(2), @TAB char(1)
    SET @CRLF = CHAR(13) + CHAR(10)
    SET @TAB = CHAR(9)

    Now you not only have a nicer, self-documenting variable, but also, if you mistype the variable, the compiler catches it, but if you mistype the CHAR function values (9, 10, or 13) that won't get caught at compile time.

    --Peter