@location <>0)
begin
select @start = @location +1
select @location = charindex('''','''',@str,@start)
select @next =@next +1
end
select @int_return = @next-2
return @int_return
end
2、 获取指定索引的值的函数
create function getstrofindex (@str varchar(8000),@index int =0)
returns varchar(8000)
as
begin
declare @str_return varchar(8000)
declare @start int
declare @next int
declare @location int
select @start =1
select @next =1 --如果习惯从0开始则select @next =0
select @location = charindex上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |