--创建分割函数CREATE FUNCTION dbo.Split(@String varchar(8000),@Delimiter char(1))returns @temptable TABLE (items varchar(8000))asbegin declare @idx int declare @slice varchar(8000) select @idx = 1 if len(@String)<1 or @String is null return while @idx!= 0…
ALTER function [dbo].[StrToList_Test](@Str varchar()) returns @table table( value nvarchar(max) ) as begin declare @tempStr nvarchar(max),@len INT = LEN(@fg); --去除前后分割符 ,@len)=@fg begin ,len(@Str)) end while RIGHT(@Str,@len)=@fg begin ,len(@Str)-@len…
例1 代码如下 复制代码 create function f_split(@SourceSql varchar(8000),@StrSeprate varchar(10))returns @temp table(a varchar(100))--实现split功能 的函数--date :2003-10-14as begin declare @i int set @SourceSql=rtrim(ltrim(@SourceSql)) set @i=charindex(@StrSeprate,@So…