<?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 Characters From a String</title>
	<atom:link href="http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: deepa</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-150925</link>
		<dc:creator><![CDATA[deepa]]></dc:creator>
		<pubDate>Wed, 27 Jul 2011 01:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-150925</guid>
		<description><![CDATA[Hi,

I have a string that has repeating chars
I mean  &#039;vvabcdcbb&#039;

I want to only find the one   vv, bb 
please suggest me.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have a string that has repeating chars<br />
I mean  &#8216;vvabcdcbb&#8217;</p>
<p>I want to only find the one   vv, bb<br />
please suggest me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-104137</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 07 Dec 2010 11:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-104137</guid>
		<description><![CDATA[Post some sample data with expected result]]></description>
		<content:encoded><![CDATA[<p>Post some sample data with expected result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Poongodi</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-104125</link>
		<dc:creator><![CDATA[Poongodi]]></dc:creator>
		<pubDate>Tue, 07 Dec 2010 09:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-104125</guid>
		<description><![CDATA[Hi,

      How to remove spaces in middle of the string after the comma in sql server 2005.

Regards,
V.Poongodi]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>      How to remove spaces in middle of the string after the comma in sql server 2005.</p>
<p>Regards,<br />
V.Poongodi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-55671</link>
		<dc:creator><![CDATA[Peter]]></dc:creator>
		<pubDate>Mon, 07 Sep 2009 14:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-55671</guid>
		<description><![CDATA[thanks a lot it realy helps me.]]></description>
		<content:encoded><![CDATA[<p>thanks a lot it realy helps me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - Remove Duplicate Entry from Comma Delimited String - UDF Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45638</link>
		<dc:creator><![CDATA[SQL SERVER - Remove Duplicate Entry from Comma Delimited String - UDF Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 13:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45638</guid>
		<description><![CDATA[[...] Reader Ashish Jain has posted very simple script which will remove duplicate entry from comma delimited string. User [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Reader Ashish Jain has posted very simple script which will remove duplicate entry from comma delimited string. User [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish Jain</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45626</link>
		<dc:creator><![CDATA[Ashish Jain]]></dc:creator>
		<pubDate>Thu, 15 Jan 2009 05:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45626</guid>
		<description><![CDATA[@Vimal

You can use following funtion to remove duplicate entry from string....
First I have convert values from list to table then select distinct then convert table to string...

CREATE FUNCTION dbo.udf_List2Table
    (
        @List VARCHAR(MAX),
        @Delim CHAR
    )
RETURNS
    @ParsedList TABLE
    (
                item VARCHAR(MAX)
    )
            AS
    BEGIN
		declare	@list1 varchar(max), @Pos int
		set @list = ltrim(rtrim(@list))+@Delim
		Set @pos = charindex(@delim, @list, 1)
		while @pos &gt; 0
			Begin
				set @list1 = ltrim(rtrim(left(@list, @pos - 1)))
				if @list1  &#039;&#039;	
				Insert into @ParsedList values (cast(@list1 as varchar(max)))
			set @list = substring(@list, @pos+1, len(@list)) 
			set @pos = 	charindex(@delim, @list, 1)	
			end
	Return 

	end
	

declare @list varchar(max)
select @list = coalesce(@list+&#039;,&#039;,&#039;&#039;) + A.item from (SELECT distinct item FROM dbo.udf_List2Table(&#039;342,34,456,34,3454,456,&#039;,&#039;,&#039;)) as A
print @list

Let me know if if your problem has been solved by this....]]></description>
		<content:encoded><![CDATA[<p>@Vimal</p>
<p>You can use following funtion to remove duplicate entry from string&#8230;.<br />
First I have convert values from list to table then select distinct then convert table to string&#8230;</p>
<p>CREATE FUNCTION dbo.udf_List2Table<br />
    (<br />
        @List VARCHAR(MAX),<br />
        @Delim CHAR<br />
    )<br />
RETURNS<br />
    @ParsedList TABLE<br />
    (<br />
                item VARCHAR(MAX)<br />
    )<br />
            AS<br />
    BEGIN<br />
		declare	@list1 varchar(max), @Pos int<br />
		set @list = ltrim(rtrim(@list))+@Delim<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 />
				Insert into @ParsedList 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 />
	Return </p>
<p>	end</p>
<p>declare @list varchar(max)<br />
select @list = coalesce(@list+&#8217;,',&#8221;) + A.item from (SELECT distinct item FROM dbo.udf_List2Table(&#8217;342,34,456,34,3454,456,&#8217;,',&#8217;)) as A<br />
print @list</p>
<p>Let me know if if your problem has been solved by this&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vimal Saifudin</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45455</link>
		<dc:creator><![CDATA[Vimal Saifudin]]></dc:creator>
		<pubDate>Thu, 08 Jan 2009 07:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-45455</guid>
		<description><![CDATA[I have string @positive = 342,34,456,34,3454,456,
Can anyone help me to remove the duplicate values from the above string to @positive=342,34,456,3454]]></description>
		<content:encoded><![CDATA[<p>I have string @positive = 342,34,456,34,3454,456,<br />
Can anyone help me to remove the duplicate values from the above string to @positive=342,34,456,3454</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karthikeyan N</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-34023</link>
		<dc:creator><![CDATA[karthikeyan N]]></dc:creator>
		<pubDate>Wed, 27 Feb 2008 13:05:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-34023</guid>
		<description><![CDATA[this is also one type of method 
also following  transfered like sp or function

declare  @i int
declare  @c char
declare  @rst varchar(8000)
set @i=1
set @rst=substring(&#039;aaassrt&#039;,1,1)
set @c=&#039;&#039;

while @i&lt;=len(&#039;aaassrt&#039;)
begin 
	set @c=substring(&#039;aaassrt&#039;,@i,1)
	if charindex( @c,@rst,1)=0
		set @rst=@rst+@c
	set @i=@i+1
end 
select @rst]]></description>
		<content:encoded><![CDATA[<p>this is also one type of method<br />
also following  transfered like sp or function</p>
<p>declare  @i int<br />
declare  @c char<br />
declare  @rst varchar(8000)<br />
set @i=1<br />
set @rst=substring(&#8216;aaassrt&#8217;,1,1)<br />
set @c=&#8221;</p>
<p>while @i&lt;=len(&#8216;aaassrt&#8217;)<br />
begin<br />
	set @c=substring(&#8216;aaassrt&#8217;,@i,1)<br />
	if charindex( @c,@rst,1)=0<br />
		set @rst=@rst+@c<br />
	set @i=@i+1<br />
end<br />
select @rst</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-33780</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Fri, 15 Feb 2008 12:45:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-33780</guid>
		<description><![CDATA[Kris, 

try this


select * from table
where &#039;&amp;&#039;+@search_string+&#039;&amp;&#039; like &#039;%&amp;&#039;+cast(col as varchar(10))+&#039;&amp;%&#039;]]></description>
		<content:encoded><![CDATA[<p>Kris, </p>
<p>try this</p>
<p>select * from table<br />
where &#8216;&amp;&#8217;+@search_string+&#8217;&amp;&#8217; like &#8216;%&amp;&#8217;+cast(col as varchar(10))+&#8217;&amp;%&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kris</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30719</link>
		<dc:creator><![CDATA[kris]]></dc:creator>
		<pubDate>Tue, 01 Jan 2008 15:28:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30719</guid>
		<description><![CDATA[Hi Madhivanan, 

thanks for your reply. the query is returning the values like :
1
3
23

So there is no need to split the values.

Actually i didnt design the database, somebody else did. I was just asked to help regarding this issue. 

Right now they are constructing a dinamic query in the program by using LIKE based on the query results and then passing it to SQL SERVER.

many LIKEs in the query is really slowing down the process. So i want to know is there any other way to make it fast.]]></description>
		<content:encoded><![CDATA[<p>Hi Madhivanan, </p>
<p>thanks for your reply. the query is returning the values like :<br />
1<br />
3<br />
23</p>
<p>So there is no need to split the values.</p>
<p>Actually i didnt design the database, somebody else did. I was just asked to help regarding this issue. </p>
<p>Right now they are constructing a dinamic query in the program by using LIKE based on the query results and then passing it to SQL SERVER.</p>
<p>many LIKEs in the query is really slowing down the process. So i want to know is there any other way to make it fast.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30511</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Mon, 31 Dec 2007 12:54:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30511</guid>
		<description><![CDATA[kris,

You need to split the values return from another query and check againt table column. Search for Split + sql server in google

Also I suggest you to read about normalisation]]></description>
		<content:encoded><![CDATA[<p>kris,</p>
<p>You need to split the values return from another query and check againt table column. Search for Split + sql server in google</p>
<p>Also I suggest you to read about normalisation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kris</title>
		<link>http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30476</link>
		<dc:creator><![CDATA[kris]]></dc:creator>
		<pubDate>Mon, 31 Dec 2007 05:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/12/30/sql-server-remove-duplicate-characters-from-a-string/#comment-30476</guid>
		<description><![CDATA[hi little help here plz, 



i have table with the data like below:

ids_cloumn
========================
1 , 2 , 4 , 23 , 12 , 11 , 9 , 8 , 7 , 10 ,
1 , 3 , 4 , 21 , 16 , 12 , 19 , 10 ,
2 , 3 , 6 , 24 , 15 , 18 , 9 , 8 ,
3 , 5 , 8 , 27 , 14 , 19 , 39 , 7 , 13 ,
1 , 7 , 9 , 28 , 19 , 11 , 29 , 8 , 

i am having a list of nos with me (coming from another query)
ex1: 1, 3 &amp; 23
ex2 : 1, 6, 34 &amp; 23

now i want to retrieve the list of rows which is having any of the nos.

is there any other way with out using “LIKE %”

If i am using like i need to write so many OR conditions based on the inputs.

thanks]]></description>
		<content:encoded><![CDATA[<p>hi little help here plz, </p>
<p>i have table with the data like below:</p>
<p>ids_cloumn<br />
========================<br />
1 , 2 , 4 , 23 , 12 , 11 , 9 , 8 , 7 , 10 ,<br />
1 , 3 , 4 , 21 , 16 , 12 , 19 , 10 ,<br />
2 , 3 , 6 , 24 , 15 , 18 , 9 , 8 ,<br />
3 , 5 , 8 , 27 , 14 , 19 , 39 , 7 , 13 ,<br />
1 , 7 , 9 , 28 , 19 , 11 , 29 , 8 , </p>
<p>i am having a list of nos with me (coming from another query)<br />
ex1: 1, 3 &amp; 23<br />
ex2 : 1, 6, 34 &amp; 23</p>
<p>now i want to retrieve the list of rows which is having any of the nos.</p>
<p>is there any other way with out using “LIKE %”</p>
<p>If i am using like i need to write so many OR conditions based on the inputs.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

