From the course: Querying Microsoft SQL Server 2022

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

String functions

String functions

- [Instructor] String functions are used to manipulate text values stored in a data table. Let's take a look at a couple by first writing out a simple query that pulls out the First and Last Name columns from the Person.Person table. This query will just return the names from the table and we can see that we have over 19,000 records to work with. Now let's process all of these names to convert their case. The UPPER function will return text converted into all uppercase characters. To use it, I'll open a parenthesis after the name UPPER, and supply the column that I want to process. Let's process the first name values. Then I'll give this column an alias and I'll call it as uppercase. There's also a built in LOWER function that does the same thing, but it converts everything to lowercase letters. I'll use it to process the last name data. If you execute the query, you'll see we have four columns now, and the first…

Contents