Reputation: 4767
What would be the proper format for the following regular expression in SQL Server?
select top 100 *
from posts
where tags like '(c++)|(performance)'
Upvotes: 0
Views: 263
Reputation: 521194
SQL Server does not support formal regex, so you will have to use LIKE
here:
SELECT TOP 100 *
FROM posts
WHERE tags LIKE '%c++%' OR tags LIKE '%performance%';
Note: If the tags
column really stores one tag per record, then just use equality checks:
SELECT TOP 100 *
FROM posts
WHERE tags IN ('%c++', 'performance');
Upvotes: 2