From the course: SQL Server 2008 Essential Training

Unlock the full course today

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

Using string functions

Using string functions - SQL Server Tutorial

From the course: SQL Server 2008 Essential Training

Start my 1-month free trial

Using string functions

Every SQL Server database you are going to work with is likely to contain immense amounts of text in varchar and char columns. So it's no surprise that there are many string functions to deal with that text and let me go through a few of those. So I am going to use AdventureWorksLT just to have some columns to work with and play around with here. Let's say we just start off with a very simple SELECT statement, selecting the LastName FROM SalesLT.Customer. Now, this is no surprise. We are not using a function yet. It's simply going to go against that table and fetch every row but just that one column. But we can use that information and feed that into any of those string functions. We could start with the simple ones. There're functions like UPPER. It shows up in hot pink here and just takes one argument. We feed in LastName into the UPPER function and it will return the result of that function, which in this case not surprisingly is just turning all of those LastNames into uppercase…

Contents