:::: MENU ::::

T-SQL wild card characters for use with like operator

  • Apr 26 / 2011
  • 1
dbDigger, T-SQL Interview Questions, T-SQL Tips and Tricks

T-SQL wild card characters for use with like operator

SQL Server provides four wild card characters to use with like operator. These are % , _ , [], [^]. These wild card characters provide very powerful capabilities to operate on string data. At morning i was required to operate on a column with strings containing digits. There were few values where alphabets were also in the value. I was required to separate the values which also contain  alphabets along with digits.
This can be done by using above mentioned wild card characters in T-SQL. Following is full example

In the same way you can build many more regular expressions as required in a specific scenario.

Consult us to explore the Databases. Contact us