The string concatenation operator

The string operator + can concatenate two or more character or binary expressions. For example:

  1. select Name = (au_lname + ", " + au_fname) 
        from authors
    

    Displays author names under the column heading “Name” in last-name, first-name order, with a comma after the last name; for example, “Bennett, Abraham.”

  2. select "abc" + "" + "def"
    

    Returns the string “abc def”. The empty string is interpreted as a single space in all char, varchar, nchar, nvarchar, and text concatenation, and in varchar insert and assignment statements.

When concatenating noncharacter, nonbinary expressions, use convert:

select "The date is " + 
    convert(varchar(12), getdate())