Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 在SQL Server存储过程中使用RegExp_Sql Server_Regex_Tsql - Fatal编程技术网

Sql server 在SQL Server存储过程中使用RegExp

Sql server 在SQL Server存储过程中使用RegExp,sql-server,regex,tsql,Sql Server,Regex,Tsql,这是VB脚本中的代码,如果我要在SQL Server中构建一个名为dbo.FileNameEncode(str)的函数,该怎么做 Function FileNameEncode(ByVal strFileName) Dim oReg strFileName = LTrim(Rtrim(strFileName)) Set oReg = New RegExp oReg.IgnoreCase = True oReg.Glo

这是VB脚本中的代码,如果我要在SQL Server中构建一个名为dbo.FileNameEncode(str)的函数,该怎么做

Function FileNameEncode(ByVal strFileName)     
    Dim oReg     
    strFileName = LTrim(Rtrim(strFileName))
    Set oReg = New RegExp     
    oReg.IgnoreCase = True     
    oReg.Global = True     
    oReg.Pattern = "[^a-z\d\s.]+"     
    FileNameEncode = Replace(oReg.Replace(strFileName, ""), " ", "_")     
    Set oReg = Nothing 
End Function 
将其作为SQL Server编写