I have a table with three fields, FirstName, LastName and Email.
Here\'s some dummy data:
FirstName | LastName | Email
Adam West adam@west.c
SQL Server does not have a CONCAT
function.
(Update: Starting from MS SQL Server 2012 it was introduced CONCAT function)
In the default SQL Server behavior, NULLs propagate through an expression.
In SQL Server, one would write:
SELECT FirstName + LastName + Email as Vitals FROM MEMBERS
If you need to handle NULL
s:
SELECT ISNULL(FirstName, '') + ISNULL(LastName, '') + ISNULL(Email, '') as Vitals FROM MEMBERS