/*== dbo.Split_XML ==*/ SQL Server Execution Times: CPU time = 118857 ms, elapsed time = 120583 ms. /*== dbo.Split_RCTE ==*/ SQL Server Execution Times: CPU time = 134660 ms, elapsed time = 138365 ms.I also checked my inline TVF xml function, but really sucks, despite the fact that it is inline:
create function dbo.udf_SplitXmlInlineTvf ( @Parameter varchar(max), @Delimiter char(1) ) returns table with schemabinding as return select cast(row_number() over (order by (select null)) as int) ItemNumber, R.Item.value('text()[1]', 'varchar(max)') ItemValue from (select cast(''+replace(@Parameter, @Delimiter, '')+'' as xml)) X(N) cross apply N.nodes('//r') R(Item); goI guess the cross apply of the cross apply is not a good way to go.
5 People are following this question.