SQL语句能否包含子程序调用?
Function GotTopic(Str,StrLen)
Dim l,t,c, i,LableStr,regEx,Match,Matches
If StrLen=0 then
GotTopic=""
exit function
End If
if IsNull(Str) then
GotTopic = ""
Exit Function
end if
if Str = "" then
GotTopic=""
Exit Function
end If
Str=Replace(Replace(Replace(Replace(Str," "," "),""",Chr(34)),">",">"),"<"," <")
l=len(str)
t=0
strlen=Clng(strLen)
for i=1 to l
c=Abs(Asc(Mid(str,i,1)))
if c>255 then
t=t+2
else
t=t+1
end if
if t>=strlen then
GotTopic=left(str,i)
exit for
else
GotTopic=str
end if
Next
GotTopic = Replace(Replace(Replace(Replace(GotTopic," "," "),Chr(34),"""),">",">")," <","<")
End Function
Sql = "select * from tb where dbo.f_GotTopic(content,3)='123'"
这种不行.我想问的是SQL语句中可以包含自定义函数.这个自定义函数.只能写在存储过程里吗?
像上面的用VBSCRIPT写的不能用吗?