Viewing 5 posts - 1 through 6 (of 6 total)
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,...
March 29, 2013 at 4:57 am
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=...
March 27, 2013 at 5:57 pm
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...
March 27, 2013 at 4:24 pm
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...
March 27, 2013 at 3:17 pm
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...
March 27, 2013 at 3:00 pm
Viewing 5 posts - 1 through 6 (of 6 total)