Great! You have completed a simple task using
LIKE. However, T-SQL and T-SQL Server provide additional ways to use
LIKE. One is with square brackets
[ ]. You simply put characters in the brackets and place them where these characters would occur in the string.
Look at the following example:
WHERE FirstName LIKE N'[AM]____' ;
This pattern matches all first names that have A or M as the first letter and any of the next 3 letters.
What about a wildcard character that allows you to exclude one of a given set of characters? In this case, you can use
^ as the first character in the square brackets. In this pattern:
only strings that do not start with A, C, or H will match.
You can also use
 to indicate a range letters or numbers. For example:
N'[0-9]': denotes 0,1,2,3,4,5,6,7,8,9
N'[b-f]': denotes b,c,d,e,f