If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Be aware that the LIKE solution doesn't scale well. It guarantees a table scan, so on large tables it will be slow.
The solution that Thrasymachus proposed works against a column value instead of an expression, so it can use indicies. It will scale well against the largest tables you can create using SQL Server.