You add it to the SqlFunctionAttribute in the C# code:
public partial class CTSStoredProcs
{
[Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=true, IsPrecise=true)]
public static SqlBoolean RegExValidate(
SqlString expressionToValidate, SqlString regularExpression)
{
Regex regex = new Regex(regularExpression.Value);
return regex.IsMatch(expressionToValidate.Value);
}
}
... nothing different on the T-SQL side.
--
Adam Machanic
whoisactive