How can we help you today? How can we help you today?

comma placement: variable assignments inside select clause

When a select statement contains multiple variable assignments, the commas get placed on a line by themselves.
SELECT    
        @firstChar = CHARINDEX('-', output, 0)
        , 
        @lastChar = CHARINDEX('- ', output, 0) + 1
FROM      #results
WHERE   ID = 2

Give my settings, it should look more like this:
SELECT    
          @firstChar = CHARINDEX('-', output, 0)
        , @lastChar = CHARINDEX('- ', output, 0) + 1
FROM      #results
WHERE   ID = 2
majahanson311
0

Comments

1 comment

  • Andras B
    When a select statement contains multiple variable assignments, the commas get placed on a line by themselves.
    SELECT    
            @firstChar = CHARINDEX('-', output, 0)
            , 
            @lastChar = CHARINDEX('- ', output, 0) + 1
    FROM      #results
    WHERE   ID = 2
    

    Give my settings, it should look more like this:
    SELECT    
              @firstChar = CHARINDEX('-', output, 0)
            , @lastChar = CHARINDEX('- ', output, 0) + 1
    FROM      #results
    WHERE   ID = 2
    

    Many thanks for reporting this. This is a bug, and we have already fixed in in our internal builds, so it should work properly in the final release :).

    Once again many thanks,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.