From the course: Querying Microsoft SQL Server 2019

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Text concatenation

Text concatenation - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Text concatenation

- [Narrator] Text concatenation is the process of joining two text strings together. SQL server has two concatenation functions that we can use that will do just that in our query of results. I'm going to start with these same first and last name fields out of the person dot person table that we used in the last movie. That'll pull the raw data that we can work with out of the data table. Now in order to turn both the first name and the last name columns together in a single column, you can use the concat function. I'll go ahead and add that to line number three. Concat takes at least two arguments and as many as 254, but they're all just these strings that you want to put together end to end. In our case I want to join the values in the first name column to those in the last name column. I'll just type that out as a comma separated list. I'll also give this column a name, I'll call it AS FullName. The results…

Contents