• coool_sweet - Thursday, February 8, 2018 6:14 PM

    hi ,

    I I have 2 column, column1 and column2.

    I need to concat this 2 column with column1 should have 40 white space after table.

    example ,

    123234    10

    23            12

    1234         12

    I am using space function but values are not  showing right in table.

    when I place this column in '' its showing right. but in the table its like below.

    cast

    (LEFT(column1+space(45),45)  aschar(45))+cast(column2aschar(1))

    please help

    The SSMS results panel uses a variable width font as the default.  Since spaces are narrower than numbers, they will not line up using the default font.  If you want to see how they line up, try outputting to text instead of grid.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA