• It's not a bug: CR is carriage return, so the line is the same.

    The line 2 is not printed beacuse the print command is joined to the commented line.

    So, change the single line comment with /**/. All lines will be printed.

    declare @sql varchar(100)

    declare @cr char(1)

    declare @NL char(1)

    set @cr = char(13)

    set @NL = char(10)

    set @sql =

    'print 1' + @cr + @NL +

    '/* Comment one */' + @cr +

    'print 2' + @cr + @NL +

    '/* Comment two*/' + @cr + @NL +

    'print 3' + @cr + @NL +

    '/* Comment three*/' + @NL +

    'print 4'

    print '

    What you see...'

    print '-----------------------'

    print @sql

    print '

    is not what you get!'

    print '-----------------------'

    exec (@sql)