Great! Now, what happens if we don't know precisely what string we're looking for, but we have a rough idea? With text values, you can always use the
LIKE operator instead of the equality operator. What does this change? Well, take a look at the following example:
WHERE Name LIKE N'A%';
LIKE allows for the use of the percentage wildcard (
%). The percentage wildcard (
%) applied in the example replaces any number (zero or more) of unknown characters.
As a result, we'll obtain all users whose name begins with the letter
'A'. We may not remember someone's exact name, but we know it begins with an
'A' and that's enough for our purposes. Convenient, right?