<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Remove Duplicate Entry from Comma Delimited String &#8211; UDF</title>
	<atom:link href="http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #012 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-409572</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #012 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 19 Jan 2013 01:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-409572</guid>
		<description><![CDATA[[...] Remove Duplicate Entry from Comma Delimited String – UDF User Defined Function has very simple logic behind it. It takes a comma delimited string and then converts it to the table and runs the DISTINCT operation on the table. DISTINCT operation removes duplicate value. After that it converts the table again into the string and it can be used.  I would suggest that this UDF should be kept handy to perform this tedious task of removing duplicate entry from comma delimited string easily.  [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Remove Duplicate Entry from Comma Delimited String – UDF User Defined Function has very simple logic behind it. It takes a comma delimited string and then converts it to the table and runs the DISTINCT operation on the table. DISTINCT operation removes duplicate value. After that it converts the table again into the string and it can be used.  I would suggest that this UDF should be kept handy to perform this tedious task of removing duplicate entry from comma delimited string easily.  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sai</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-372239</link>
		<dc:creator><![CDATA[sai]]></dc:creator>
		<pubDate>Sat, 10 Nov 2012 16:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-372239</guid>
		<description><![CDATA[to remove duplicate id&#039;s under columns i faced lot of strougle but it s very greatful to me]]></description>
		<content:encoded><![CDATA[<p>to remove duplicate id&#8217;s under columns i faced lot of strougle but it s very greatful to me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Undye</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-137623</link>
		<dc:creator><![CDATA[Undye]]></dc:creator>
		<pubDate>Mon, 30 May 2011 14:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-137623</guid>
		<description><![CDATA[Good idea and code .. Just one problem though: .. having dynamic field names in the query, there are cases like &quot;ISNULL(, &#039;&#039;)&quot; - which the funtion will split by &quot;,&quot; ..]]></description>
		<content:encoded><![CDATA[<p>Good idea and code .. Just one problem though: .. having dynamic field names in the query, there are cases like &#8220;ISNULL(, &#8221;)&#8221; &#8211; which the funtion will split by &#8220;,&#8221; ..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naren</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-124512</link>
		<dc:creator><![CDATA[Naren]]></dc:creator>
		<pubDate>Wed, 23 Mar 2011 07:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-124512</guid>
		<description><![CDATA[i have problem in solving the following case.can any one help regarding this one

Input =   &#039;A:1, 1, 2, 4 B:3, 5, 5, 6 C:7, 7, 9, 4&#039;
 
Required Output = &#039;A:1, 2, 4 B:3, 5, 6 C:4, 7, 9&#039;]]></description>
		<content:encoded><![CDATA[<p>i have problem in solving the following case.can any one help regarding this one</p>
<p>Input =   &#8216;A:1, 1, 2, 4 B:3, 5, 5, 6 C:7, 7, 9, 4&#8242;</p>
<p>Required Output = &#8216;A:1, 2, 4 B:3, 5, 6 C:4, 7, 9&#8242;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aluri</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-86661</link>
		<dc:creator><![CDATA[aluri]]></dc:creator>
		<pubDate>Sun, 05 Sep 2010 11:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-86661</guid>
		<description><![CDATA[Hi ,i am Aluri from bangalore and i am a dot net developer ,i hv a requirement that i couldn&#039;t solve,hope you can solve my problem:
well my requirement is to count duplicate words in a sentense which is stored in a column example:
1. I am A software engineer.I am a dot net developer.
that is one record,what i need is,to count homany times repeted values in that record ,and the result would be like this:
I am (2)
Software(2)
like that,i realy tried many string functions but faild to get the right result,hope you can help me

my mail id is:  [email id removed]
thank you

Aluri]]></description>
		<content:encoded><![CDATA[<p>Hi ,i am Aluri from bangalore and i am a dot net developer ,i hv a requirement that i couldn&#8217;t solve,hope you can solve my problem:<br />
well my requirement is to count duplicate words in a sentense which is stored in a column example:<br />
1. I am A software engineer.I am a dot net developer.<br />
that is one record,what i need is,to count homany times repeted values in that record ,and the result would be like this:<br />
I am (2)<br />
Software(2)<br />
like that,i realy tried many string functions but faild to get the right result,hope you can help me</p>
<p>my mail id is:  [email id removed]<br />
thank you</p>
<p>Aluri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MALINI</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-77950</link>
		<dc:creator><![CDATA[MALINI]]></dc:creator>
		<pubDate>Mon, 28 Jun 2010 18:41:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-77950</guid>
		<description><![CDATA[CREATE FUNCTION DBO.DISTINCT_MSG_SEQ
(
    @LIST VARCHAR(MAX)
)
    RETURNS VARCHAR(MAX)
AS
BEGIN
    DECLARE @DISTINCT_MSGLIST TABLE
    (
	S_NO	INT IDENTITY(1,1),
    ITEM VARCHAR(MAX)
    )
    DECLARE @LIST1 VARCHAR(MAX), 
			@POS INT, 
			@RLIST VARCHAR(MAX),
			@MAX VARCHAR(MAX),
			@DELIM VARCHAR 
	SET @DELIM = &#039;,&#039;
    SET @LIST = LTRIM(RTRIM(@LIST)) + @DELIM
    SET @POS = CHARINDEX(@DELIM, @LIST, 1)
	SET @LIST1 = LTRIM(RTRIM(LEFT(@LIST, @POS - 1)))
		
    INSERT INTO @DISTINCT_MSGLIST VALUES (CAST(@LIST1 AS VARCHAR(MAX)))
	SET @LIST = SUBSTRING(@LIST, @POS+1, LEN(@LIST))
	SET @POS = CHARINDEX(@DELIM, @LIST, 1)
    WHILE @POS &gt; 0
		BEGIN
		SET @LIST1 = LTRIM(RTRIM(LEFT(@LIST, @POS - 1)))
		IF @LIST1  &#039;&#039; 
			SELECT @MAX = ITEM FROM @DISTINCT_MSGLIST WHERE S_NO = ISNULL((SELECT MAX(S_NO) FROM @DISTINCT_MSGLIST) ,0)
			IF @MAX  @LIST1
			INSERT INTO @DISTINCT_MSGLIST VALUES (CAST(@LIST1 AS VARCHAR(MAX)))
		SET @LIST = SUBSTRING(@LIST, @POS+1, LEN(@LIST))
		SET @POS = CHARINDEX(@DELIM, @LIST, 1)
    END
    SELECT @RLIST = COALESCE(@RLIST+&#039;,&#039;,&#039;&#039;) + ITEM
    FROM (SELECT  ITEM FROM @DISTINCT_MSGLIST) T

	RETURN @RLIST
	
END

The above function will display the unique msg sequence from the list 

eg : - If you pass the string &#039;A,A,B,B,A,B&#039; , this function gives the output as &#039;A,B,A,B&#039;]]></description>
		<content:encoded><![CDATA[<p>CREATE FUNCTION DBO.DISTINCT_MSG_SEQ<br />
(<br />
    @LIST VARCHAR(MAX)<br />
)<br />
    RETURNS VARCHAR(MAX)<br />
AS<br />
BEGIN<br />
    DECLARE @DISTINCT_MSGLIST TABLE<br />
    (<br />
	S_NO	INT IDENTITY(1,1),<br />
    ITEM VARCHAR(MAX)<br />
    )<br />
    DECLARE @LIST1 VARCHAR(MAX),<br />
			@POS INT,<br />
			@RLIST VARCHAR(MAX),<br />
			@MAX VARCHAR(MAX),<br />
			@DELIM VARCHAR<br />
	SET @DELIM = &#8216;,&#8217;<br />
    SET @LIST = LTRIM(RTRIM(@LIST)) + @DELIM<br />
    SET @POS = CHARINDEX(@DELIM, @LIST, 1)<br />
	SET @LIST1 = LTRIM(RTRIM(LEFT(@LIST, @POS &#8211; 1)))</p>
<p>    INSERT INTO @DISTINCT_MSGLIST VALUES (CAST(@LIST1 AS VARCHAR(MAX)))<br />
	SET @LIST = SUBSTRING(@LIST, @POS+1, LEN(@LIST))<br />
	SET @POS = CHARINDEX(@DELIM, @LIST, 1)<br />
    WHILE @POS &gt; 0<br />
		BEGIN<br />
		SET @LIST1 = LTRIM(RTRIM(LEFT(@LIST, @POS &#8211; 1)))<br />
		IF @LIST1  &#8221;<br />
			SELECT @MAX = ITEM FROM @DISTINCT_MSGLIST WHERE S_NO = ISNULL((SELECT MAX(S_NO) FROM @DISTINCT_MSGLIST) ,0)<br />
			IF @MAX  @LIST1<br />
			INSERT INTO @DISTINCT_MSGLIST VALUES (CAST(@LIST1 AS VARCHAR(MAX)))<br />
		SET @LIST = SUBSTRING(@LIST, @POS+1, LEN(@LIST))<br />
		SET @POS = CHARINDEX(@DELIM, @LIST, 1)<br />
    END<br />
    SELECT @RLIST = COALESCE(@RLIST+&#8217;,',&#8221;) + ITEM<br />
    FROM (SELECT  ITEM FROM @DISTINCT_MSGLIST) T</p>
<p>	RETURN @RLIST</p>
<p>END</p>
<p>The above function will display the unique msg sequence from the list </p>
<p>eg : &#8211; If you pass the string &#8216;A,A,B,B,A,B&#8217; , this function gives the output as &#8216;A,B,A,B&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-75832</link>
		<dc:creator><![CDATA[Ramesh]]></dc:creator>
		<pubDate>Sat, 12 Jun 2010 18:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-75832</guid>
		<description><![CDATA[Use this one to split string

DECLARE @str varchar(100),@sep VARCHAR(10)
select @str = &#039;1,2,3,4&#039; ,@sep = &#039;,&#039;
;
WITH Split(stpos,Endpos)
AS( SELECT 0  stpos 
          ,CHARINDEX(@sep,@str) Endpos
    UNION ALL
    SELECT Endpos+1
          ,CHARINDEX(@sep,@str,Endpos+1) 
    FROM split  
    WHERE  Endpos &gt; 0   
)
SELECT SUBSTRING(@str,stpos,COALESCE(NULLIF(Endpos,0),LEN(@str)+1)-stpos)
FROM split]]></description>
		<content:encoded><![CDATA[<p>Use this one to split string</p>
<p>DECLARE @str varchar(100),@sep VARCHAR(10)<br />
select @str = &#8217;1,2,3,4&#8242; ,@sep = &#8216;,&#8217;<br />
;<br />
WITH Split(stpos,Endpos)<br />
AS( SELECT 0  stpos<br />
          ,CHARINDEX(@sep,@str) Endpos<br />
    UNION ALL<br />
    SELECT Endpos+1<br />
          ,CHARINDEX(@sep,@str,Endpos+1)<br />
    FROM split<br />
    WHERE  Endpos &gt; 0<br />
)<br />
SELECT SUBSTRING(@str,stpos,COALESCE(NULLIF(Endpos,0),LEN(@str)+1)-stpos)<br />
FROM split</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Morris</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-59945</link>
		<dc:creator><![CDATA[Justin Morris]]></dc:creator>
		<pubDate>Tue, 19 Jan 2010 16:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-59945</guid>
		<description><![CDATA[Thanks for your post, how do you keep the same order in the comma delimited list?  After using dbo.DistintList() it changes the order to SQL ordering, meaning numbers first then letters.  I am trying to take individual rows of products and create the size/color array.

XS,S,M,L,XL,2XL,3XL  turns into an output of 2XL,3XL,L,M,S,XS.  

I need these to be in size order (S to 3XL).  I have another column for SortPriority but this is not obeyed after running the function.]]></description>
		<content:encoded><![CDATA[<p>Thanks for your post, how do you keep the same order in the comma delimited list?  After using dbo.DistintList() it changes the order to SQL ordering, meaning numbers first then letters.  I am trying to take individual rows of products and create the size/color array.</p>
<p>XS,S,M,L,XL,2XL,3XL  turns into an output of 2XL,3XL,L,M,S,XS.  </p>
<p>I need these to be in size order (S to 3XL).  I have another column for SortPriority but this is not obeyed after running the function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WLPLaura</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-55308</link>
		<dc:creator><![CDATA[WLPLaura]]></dc:creator>
		<pubDate>Thu, 27 Aug 2009 15:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-55308</guid>
		<description><![CDATA[I was looking for a way to do this and found your blog.  The function worked great!  So THANKS for that!  

While I was searching for how to do something totally different, however, I actually revisited the dedupe problem and came up with the following:

declare @list nvarchar(max)
set @list = &#039;342,34,456,34,3454,456,aa,bb,cc,aa&#039;
declare @x xml
declare @delim nvarchar(1)
set @delim = &#039;,&#039;

set @x = &#039;&#039;+replace(lower(@list),@delim,&#039;&#039;)+&#039;&#039;
select replace(cast(@x.query(&#039;distinct-values(data(/list/delim))&#039;) as varchar(max)),&#039; &#039;,@delim) as result

Basically I turn the delimited list in to XML and use &#039;distinct-values&#039; to get rid of dupes.  

One gotcha to keep in mind is &#039;distinct-values&#039; appears to be an exact match comparison and is why I included the &#039;lower()&#039; command.  So if @list = &#039;&#039;342,34,456,34,3454,456,aa,bb,cc,aa,AA&#039; AND you are not able to leave the &#039;lower()&#039; command in there, you&#039;d get both &#039;aa&#039; and &#039;AA&#039; in the result.

Enjoy!]]></description>
		<content:encoded><![CDATA[<p>I was looking for a way to do this and found your blog.  The function worked great!  So THANKS for that!  </p>
<p>While I was searching for how to do something totally different, however, I actually revisited the dedupe problem and came up with the following:</p>
<p>declare @list nvarchar(max)<br />
set @list = &#8217;342,34,456,34,3454,456,aa,bb,cc,aa&#8217;<br />
declare @x xml<br />
declare @delim nvarchar(1)<br />
set @delim = &#8216;,&#8217;</p>
<p>set @x = &#8221;+replace(lower(@list),@delim,&#8221;)+&#8221;<br />
select replace(cast(@x.query(&#8216;distinct-values(data(/list/delim))&#8217;) as varchar(max)),&#8217; &#8216;,@delim) as result</p>
<p>Basically I turn the delimited list in to XML and use &#8216;distinct-values&#8217; to get rid of dupes.  </p>
<p>One gotcha to keep in mind is &#8216;distinct-values&#8217; appears to be an exact match comparison and is why I included the &#8216;lower()&#8217; command.  So if @list = &#8221;342,34,456,34,3454,456,aa,bb,cc,aa,AA&#8217; AND you are not able to leave the &#8216;lower()&#8217; command in there, you&#8217;d get both &#8216;aa&#8217; and &#8216;AA&#8217; in the result.</p>
<p>Enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran Mohammed</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-55179</link>
		<dc:creator><![CDATA[Imran Mohammed]]></dc:creator>
		<pubDate>Tue, 25 Aug 2009 03:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-55179</guid>
		<description><![CDATA[@Hari, 

How about using While loop or cursor, Because I dont know any other simple method to solve this. 

1. Write a while loop, 
2. Every time assign Column2 value to a variable. 
3. use another while loop and Use substring function to reduce the size of variable and each time you reduce the size you put value into a temporary table. 
4. At the end of while loop, do a select * from temp table.

~ IM.]]></description>
		<content:encoded><![CDATA[<p>@Hari, </p>
<p>How about using While loop or cursor, Because I dont know any other simple method to solve this. </p>
<p>1. Write a while loop,<br />
2. Every time assign Column2 value to a variable.<br />
3. use another while loop and Use substring function to reduce the size of variable and each time you reduce the size you put value into a temporary table.<br />
4. At the end of while loop, do a select * from temp table.</p>
<p>~ IM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hari</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-55162</link>
		<dc:creator><![CDATA[Hari]]></dc:creator>
		<pubDate>Mon, 24 Aug 2009 15:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-55162</guid>
		<description><![CDATA[Dave,
I am impressed with your blog pages. There is lot of materail and it is really helpful for SQL pro&#039;s. 

I have a requirement and wanted to know if you or anyone can help...

Table1

ID (Pkey)    Column2 (Account numbers)

1001	U987654321
1002	123213121,3434334,881216665
1003	A123456789,C123456789
1004	U1818012, U808561773......

Column 1 is a unique ID number which is the Pkey. Column2 holds (Accoount numbers) and can have upto 12 account numbers. My requirement is convert them in to table like ....

1001	U987654321
1002	123213121
1002	3434334
1002	881216665
1003	A123456789
1003	C123456789
1004	U808561773
1004	U808561773
........

Pls let me know how to accomplish this using SQL 2008.

Thanks,
Hari]]></description>
		<content:encoded><![CDATA[<p>Dave,<br />
I am impressed with your blog pages. There is lot of materail and it is really helpful for SQL pro&#8217;s. </p>
<p>I have a requirement and wanted to know if you or anyone can help&#8230;</p>
<p>Table1</p>
<p>ID (Pkey)    Column2 (Account numbers)</p>
<p>1001	U987654321<br />
1002	123213121,3434334,881216665<br />
1003	A123456789,C123456789<br />
1004	U1818012, U808561773&#8230;&#8230;</p>
<p>Column 1 is a unique ID number which is the Pkey. Column2 holds (Accoount numbers) and can have upto 12 account numbers. My requirement is convert them in to table like &#8230;.</p>
<p>1001	U987654321<br />
1002	123213121<br />
1002	3434334<br />
1002	881216665<br />
1003	A123456789<br />
1003	C123456789<br />
1004	U808561773<br />
1004	U808561773<br />
&#8230;&#8230;..</p>
<p>Pls let me know how to accomplish this using SQL 2008.</p>
<p>Thanks,<br />
Hari</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murali</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-46024</link>
		<dc:creator><![CDATA[Murali]]></dc:creator>
		<pubDate>Tue, 27 Jan 2009 12:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-46024</guid>
		<description><![CDATA[Hi Guys,

Try out this simple solution.

CREATE FUNCTION DBO.RECU (@DATA NVARCHAR(1000))
RETURNS @RETTABLE TABLE 
( COL1 NVARCHAR(200))
AS 
BEGIN  
	IF LEN(@DATA) &gt; 0 AND CHARINDEX (&#039;,&#039;,@DATA) &gt; 0 
	BEGIN
		INSERT INTO @RETTABLE
		SELECT LEFT(@DATA,CHARINDEX (&#039;,&#039;,@DATA)-1) AS COL1
		UNION ALL
		SELECT COL1 FROM DBO.RECU(RIGHT(@DATA,LEN(@DATA)-CHARINDEX (&#039;,&#039;,@DATA)))
	END
RETURN
END

SELECT DISTINCT COL1 FROM DBO.RECU(&#039;342,34,456,34,3454,456,aa,bb,cc,aa,&#039;)

Thanks and Regards
Muralikrishnan]]></description>
		<content:encoded><![CDATA[<p>Hi Guys,</p>
<p>Try out this simple solution.</p>
<p>CREATE FUNCTION DBO.RECU (@DATA NVARCHAR(1000))<br />
RETURNS @RETTABLE TABLE<br />
( COL1 NVARCHAR(200))<br />
AS<br />
BEGIN<br />
	IF LEN(@DATA) &gt; 0 AND CHARINDEX (&#8216;,&#8217;,@DATA) &gt; 0<br />
	BEGIN<br />
		INSERT INTO @RETTABLE<br />
		SELECT LEFT(@DATA,CHARINDEX (&#8216;,&#8217;,@DATA)-1) AS COL1<br />
		UNION ALL<br />
		SELECT COL1 FROM DBO.RECU(RIGHT(@DATA,LEN(@DATA)-CHARINDEX (&#8216;,&#8217;,@DATA)))<br />
	END<br />
RETURN<br />
END</p>
<p>SELECT DISTINCT COL1 FROM DBO.RECU(&#8217;342,34,456,34,3454,456,aa,bb,cc,aa,&#8217;)</p>
<p>Thanks and Regards<br />
Muralikrishnan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Shah</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-46003</link>
		<dc:creator><![CDATA[Amit Shah]]></dc:creator>
		<pubDate>Mon, 26 Jan 2009 15:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-46003</guid>
		<description><![CDATA[Hi,

I m wroking in MNC as SQL developer i required dis function but i m not getting it so can u help me out to get dis UDF and also wat it actually does.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I m wroking in MNC as SQL developer i required dis function but i m not getting it so can u help me out to get dis UDF and also wat it actually does.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Hope</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-45655</link>
		<dc:creator><![CDATA[Gary Hope]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 21:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-45655</guid>
		<description><![CDATA[Hi Dave,

Dispite being the SQL guy I think that this really looks like one of those problems that are best cracked with CLR.

Have a look at my post http://blogs.msdn.com/garyhope/archive/2009/01/15/sql-remove-duplicates-function-t-sql-vs-clr.aspx
where I provide a demonstation of how the CLR code executes at leat 3 times faster.

]]></description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Dispite being the SQL guy I think that this really looks like one of those problems that are best cracked with CLR.</p>
<p>Have a look at my post <a href="http://blogs.msdn.com/garyhope/archive/2009/01/15/sql-remove-duplicates-function-t-sql-vs-clr.aspx" rel="nofollow">http://blogs.msdn.com/garyhope/archive/2009/01/15/sql-remove-duplicates-function-t-sql-vs-clr.aspx</a><br />
where I provide a demonstation of how the CLR code executes at leat 3 times faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Paldino</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-45644</link>
		<dc:creator><![CDATA[Nicholas Paldino]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 16:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-45644</guid>
		<description><![CDATA[What should have probably been done here is to use a CLR function, as CLR routines are much better at procedural code than T-SQL.

This could have been done in a few lines of code, and performed much better as well.]]></description>
		<content:encoded><![CDATA[<p>What should have probably been done here is to use a CLR function, as CLR routines are much better at procedural code than T-SQL.</p>
<p>This could have been done in a few lines of code, and performed much better as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chase</title>
		<link>http://blog.sqlauthority.com/2009/01/15/sql-server-remove-duplicate-entry-from-comma-delimited-string-udf/#comment-45643</link>
		<dc:creator><![CDATA[chase]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 15:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=2035#comment-45643</guid>
		<description><![CDATA[Is there a reason that
SELECT @rlist = COALESCE(@rlist+‘,’,”) + item

is not

SELECT @rlist = COALESCE(@rlist+@Delim,”) + item]]></description>
		<content:encoded><![CDATA[<p>Is there a reason that<br />
SELECT @rlist = COALESCE(@rlist+‘,’,”) + item</p>
<p>is not</p>
<p>SELECT @rlist = COALESCE(@rlist+@Delim,”) + item</p>
]]></content:encoded>
	</item>
</channel>
</rss>
