Is it possible to create a new T-SQL Operator using CLR Code in MSSQL?
- by Eoin Campbell
I have a very simple CLR Function for doing Regex Matching
public static SqlBoolean RegExMatch(SqlString input, SqlString pattern)
{
if (input.IsNull || pattern.IsNull)
return SqlBoolean.False;
return Regex.IsMatch(input.Value, pattern.Value, RegexOptions.IgnoreCase);
}
It allows me to write a SQL Statement Like.
SELECT * FROM…