标签:
CREATE function hasContent(@search nvarchar(max), @expression nvarchar(max))
returns bit
begin
declare @searchLength int = len(@search);
declare @cursor int = 1;
while @cursor <= len(@expression) - @searchLength + 1
begin
if @search = substring(@expression, @cursor, @searchLength)
begin
return 1;
end
set @cursor = @cursor + 1;
end
return 0;
end
标签:
原文地址:http://www.cnblogs.com/ly45/p/4792444.html