Forum Replies Created

Viewing 5 posts - 1 through 6 (of 6 total)

  • RE: Split strings alternative to XML

    I am now testing this one:

    CREATE FUNCTION fnSplitString(@str nvarchar(max),@sep nvarchar(max))

    RETURNS TABLE

    AS

    RETURN

    WITH a AS(

    SELECT CAST(0 AS BIGINT) as idx1,CHARINDEX(@sep,@str) idx2

    UNION ALL

    SELECT idx2+1,CHARINDEX(@sep,@str,idx2+1)

    FROM a

    WHERE idx2>0

    )

    SELECT SUBSTRING(@str,idx1,COALESCE(NULLIF(idx2,0),LEN(@str)+1)-idx1) as value

    FROM a

    Execution is more simple,...

  • RE: Split strings alternative to XML

    I have got it...

    create function Split_fnOK

    (

    @datavarchar(8000),

    @deli_char varchar(3)

    )

    returns @list table

    (

    Idxint,

    datavarchar(8000)

    )

    as

    begin

    declare @from_locint

    declare @to_locint

    if charindex(@deli_char,@data,0) <= 0

    begin

    insert into @list(Idx, data) values (1, @data)

    return

    end

    if charindex(@deli_char,@data,0) > 0

    begin

    select @from_loc= 0

    select @to_loc=...

  • RE: Split strings alternative to XML

    I am trying...but I do not succeed in adapting the 8k function.

    Don't know how to "integrate" the <d>, <d/>, etc stuff as they exist in the initial function...

    I really...

  • RE: Split strings alternative to XML

    Not sure this is absolutely necessary, maybe varchar(some values) could fit, but as of now, I do not know "where" they could use this function to split "what" amout of...

  • RE: Split strings alternative to XML

    Thanks Lynn,

    ...I have gone through the article, too much complicated to me and definitely not my stuff...

    The thing is I know the function above is killing perf, but I do...

Viewing 5 posts - 1 through 6 (of 6 total)