Open links in new tab
  1. Edit
    Perform Analysis
    Change Language
    Testing Tools
    More Actions
    Exporting to download
    Bing Writer • Generated with AI
  1. In T-SQL, you can concatenate fields using the CONCAT() function or the + operator. The CONCAT() function is preferred as it handles NULL values by converting them to empty strings, ensuring no data loss during concatenation.

    Example Using CONCAT()

    SELECT
    CONCAT(FirstName, ' ', ISNULL(MiddleName, ''), ' ', LastName) AS FullName
    FROM Employees;
    Copied!

    This query combines FirstName, MiddleName, and LastName into a single string. If MiddleName is NULL, it is replaced with an empty string.

    Example Using the + Operator

    SELECT
    ISNULL(FirstName, '') + ' ' + ISNULL(MiddleName, '') + ' ' + ISNULL(LastName, '') AS FullName
    FROM Employees;
    Copied!

    Here, the ISNULL() function ensures that NULL values are replaced with empty strings to avoid the entire result becoming NULL.

    Key Considerations

    Feedback
  2. SQL Server: Best way to concatenate multiple columns?

    I am trying to concatenate multiple columns in a query in SQL Server 11.00.3393. I tried the new function CONCAT () but it's not working when I use more than two columns. So I wonder if …

    • Reviews: 13

      Code sample

      SELECT CONCAT(LOWER(LAST_NAME), UPPER(LAST_NAME)
        INITCAP(LAST_NAME), HIRE DATE AS ‘up_low_init_hdate’)
      FROM EMPLOYEES
      WHERE HIRE DATE = 1995
    • How to Concatenate Text From Multiple Rows in SQL Server

      Jul 23, 2025 · In this article, we will discuss how to concatenate text from multiple rows into a single text string in SQL Server using various methods which are COALESCE Function, XML …

    • How to Concatenate Two Columns in SQL – A …

      Feb 16, 2023 · Learn how to concatenate two columns in SQL with this detailed guide. SQL concatenation is the process of combining two or …

    • SQL Concatenate Examples - SQL Server Tips

      • In SQL Server 2012 and later, we can use the CONCAT function. With this string function, you can concatenate multiple character string values at once. Let’s reprise the example from the previous paragraph: The beauty of the CONCAT function is that it implicitly converts all expressions to string values (if possible) within a SELECT statement. This ...
      See more on mssqltips.com
      • Published: Oct 5, 2021
      • Concatenation in SQL query – SQL Tutorial

        In summary, concatenation in SQL Server can be done using either the + operator or the CONCAT function, with CONCAT being more robust in handling NULL values.

      • Concatenate multiple columns in SQL - HayaGeek

        Nov 17, 2023 · Discover all the different ways to concatenate multiple columns in SQL. With examples and a practical guide, craft efficient …

      • How to concatenate columns in SQL Server?

        Oct 2, 2024 · 3 Ways to concatenate multiple columns in SQL In this article, I will show you examples of both + operator and CONCAT () functions to …

      • The Complete Guide to CONCAT in SQL Queries: …

        Jun 3, 2025 · With how frequently developers need to perform this operation, database systems include dedicated functions like CONCAT to streamline …

      • Concatenating Multiple Column Values in SQL Server

        Sometimes when generating reports or text for web pages or form letters, it becomes handy to concatenate multiple column values from rows of data into a single value entirely within T-SQL. …

      • Rolling up multiple rows into a single row and column for SQL Server

        Oct 24, 2025 · Learn how to roll-up multiple rows into one row and one column with concatenation in SQL Server with FOR XML, STUFF and STRING_AGG.