- ✕This summary was generated using AI based on multiple online sources. To view the original source information, use the "Learn more" links.
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()
SELECTCONCAT(FirstName, ' ', ISNULL(MiddleName, ''), ' ', LastName) AS FullNameFROM Employees;Copied!✕CopyThis 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
SELECTISNULL(FirstName, '') + ' ' + ISNULL(MiddleName, '') + ' ' + ISNULL(LastName, '') AS FullNameFROM Employees;Copied!✕CopyHere, the ISNULL() function ensures that NULL values are replaced with empty strings to avoid the entire result becoming NULL.
Key Considerations
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 EMPLOYEESWHERE HIRE DATE = 1995How 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 ...
- 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.
Related searches for How Concat Column Multiple Value in SQL