create or alter function dbo.SplitCsv ( @IdsCsv varchar(max) ) returns @result table ( Id int not null ) as begin declare @IdsXml xml = '<x v="' + replace(@IdsCsv, ',','"/><x v="') + '"/>' insert into @result(Id) select n = T.c.value('@v', 'int') from @IdsXml.nodes('x') T(c) return end
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.