这是VB Script中的代码,如果我要在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
答案 0 :(得分:2)