From the course: Microsoft SQL Server 2016: Query Data

Unlock the full course today

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

Using string concatenation

Using string concatenation - SQL Server Tutorial

From the course: Microsoft SQL Server 2016: Query Data

Start my 1-month free trial

Using string concatenation

- In this lesson we're going to take a look at string concatenation and SQL server. One of the purposes behind string concatenation is that it allows us to combine the results of the different fields in our table and generate one output column that actually brings all of those values together into one entry. As an example, think about a person's name. We typically have a last name, a first name, a middle name, and we might have a prefix and even a suffix. When we store the information in the database we typically store these individual components separately into their own columns or their own fields. So last name would be a field, first name is a field, etc. This is done so that we can filter the data, we can query based on those specific fields and not have to worry about trying to do a string parse operation on the full name and break out the individual components. So string concatenation allows us to basically combine all these components into one output string. Let's see an…

Contents