我有这个小型 CLR,它对列中的字符串执行 RegEX 函数。
在 Windows Server 2012R2 上的 SQL Server 2014 (12.0.2000) 上运行时,进程崩溃
Msg 0, Level 11, State 0, Line 0 当前命令发生严重错误。结果,如果有的话,应该被丢弃。
如果我这样做,并给出堆栈转储
select count (*) from table where (CLRREGEX,'Regex')
Run Code Online (Sandbox Code Playgroud)
但是当我这样做的时候
select * from table where (CLRREGEX,'Regex')
Run Code Online (Sandbox Code Playgroud)
它返回行。
在 Windows 8.1 上运行的相同 SQL Server 版本上完美运行。
有任何想法吗?
-- 编辑就这么简单
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlTypes; //SqlString, SqlInt32, SqlBoolean
using System.Text.RegularExpressions; //Match, Regex
using Microsoft.SqlServer.Server; //SqlFunctionAttribute
public partial class UserDefinedFunctions
{
public static readonly RegexOptions Options = RegexOptions.IgnorePatternWhitespace | …Run Code Online (Sandbox Code Playgroud)