In this post, we want to discuss search underscore in columns in SQL Server. Before we get started, if you want to know about Merge Into command in SQL Server, please go through the following article: Using Merge Into in SQL Server.

This is done by adding the ESCAPE clause to your LIKE expression. The character that is specified with the ESCAPE clause will “invalidate” the following wildcard character. You can use any character you like (just not a wildcard character). Most people use a \ because that is what many programming languages also use in SQL Server.

So your query would result in:

But you can just as well use any other character:

Search underscore in Column SQL Server

The article was published on April 24, 2017 @ 10:51 AM

Leave a Comment