How can I convert split function to inline table valued udf in SQL server?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Assuming I have this query ( pseudo) : Select T.a, T.b, (select top 1 element from fn_split(c,',') where element=T.element) From largeTable T Where fn_split runs for each row , I would like to use inline table valued udf so , that performance will be better. NB : fn_split just create a table via splitting via , : But looking at inline table valued udf structure : create FUNCTION [dbo].[fn_...] ( ... ) RETURNS table AS RETURN SELECT ...(!!!) It should return the select right away as the first statement ! But what if my UDF looks like : CREATE