时间:2021-07-01 10:21:17 帮助过:2人阅读
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
SQL搜索字符串
标签: