SQL Remove Duplicates Function (T-SQL vs CLR)

Pinal Dave did a post of an example of a function to remove duplicates from a comma delimited string. The code looks similar to this CREATE FUNCTION dbo.fnDistinctList2 ( @List VARCHAR(MAX) ) RETURNS VARCHAR(MAX) AS BEGIN DECLARE @Delim CHAR = ‘,’ DECLARE @ParsedList TABLE ( Item VARCHAR(MAX) ) DECLARE @list1 VARCHAR(MAX), @Pos INT, @rList VARCHAR(MAX)…