<?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; Find First Non-Numeric Character from String</title>
	<atom:link href="http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Wed, 19 Jun 2013 02:50:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: rahul sahay</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-429869</link>
		<dc:creator><![CDATA[rahul sahay]]></dc:creator>
		<pubDate>Fri, 01 Mar 2013 18:21:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-429869</guid>
		<description><![CDATA[Dear Pinal,

Can you please confirm wether there is any other method of achieving the result:

/* First occurrence of character in a string using table variable */
/* table variable created*/
declare @table1 table(id integer identity(1,1),name varchar(5))
insert into @table1 values (&#039;911av&#039;),(&#039;1sdf&#039;),(&#039;aaaa&#039;)

/* displaying content of table*/
select * from @table1

/* count the total number of records in the table */
declare @rcount integer
select @rcount = COUNT(name) from @table1

/* declare variable for outer loop */
declare @i_rcount integer
set @i_rcount = 1

/* loop that will run for each record */
declare @srecord varchar(10)
declare @result1 varchar(10)
declare @x integer
while(@i_rcount &lt;=@rcount)
begin
/* store the individual records here */
select @srecord = name from @table1 where id = @i_rcount
select @result1 = LEN(name) from @table1
set @x = 1
   /* checking each character in the record */
   while(@x &lt;=@result1)
   begin
   if(ISNUMERIC(left(@srecord,@x)))  1
        begin
        select &#039;First Occurence of character&#039; +&#039; &#039;+ &#039;in string:&#039;+&#039; &#039;+&#039; &#039;+ @srecord +&#039; &#039;+&#039;is&#039;+&#039; &#039;+ cast(@x as varchar(3))
        set @x = @result1+1 /* this will exit from the inner loop */
        end
        else
        set @x = @x+1
   end
   set @i_rcount = @i_rcount+1
end]]></description>
		<content:encoded><![CDATA[<p>Dear Pinal,</p>
<p>Can you please confirm wether there is any other method of achieving the result:</p>
<p>/* First occurrence of character in a string using table variable */<br />
/* table variable created*/<br />
declare @table1 table(id integer identity(1,1),name varchar(5))<br />
insert into @table1 values (&#8217;911av&#8217;),(&#8217;1sdf&#8217;),(&#8216;aaaa&#8217;)</p>
<p>/* displaying content of table*/<br />
select * from @table1</p>
<p>/* count the total number of records in the table */<br />
declare @rcount integer<br />
select @rcount = COUNT(name) from @table1</p>
<p>/* declare variable for outer loop */<br />
declare @i_rcount integer<br />
set @i_rcount = 1</p>
<p>/* loop that will run for each record */<br />
declare @srecord varchar(10)<br />
declare @result1 varchar(10)<br />
declare @x integer<br />
while(@i_rcount &lt;=@rcount)<br />
begin<br />
/* store the individual records here */<br />
select @srecord = name from @table1 where id = @i_rcount<br />
select @result1 = LEN(name) from @table1<br />
set @x = 1<br />
   /* checking each character in the record */<br />
   while(@x &lt;=@result1)<br />
   begin<br />
   if(ISNUMERIC(left(@srecord,@x)))  1<br />
        begin<br />
        select &#8216;First Occurence of character&#8217; +&#8217; &#8216;+ &#8216;in string:&#8217;+&#8217; &#8216;+&#8217; &#8216;+ @srecord +&#8217; &#8216;+&#8217;is&#8217;+&#8217; &#8216;+ cast(@x as varchar(3))<br />
        set @x = @result1+1 /* this will exit from the inner loop */<br />
        end<br />
        else<br />
        set @x = @x+1<br />
   end<br />
   set @i_rcount = @i_rcount+1<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Order By Numeric Values Formatted as String &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-363150</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Order By Numeric Values Formatted as String &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Tue, 23 Oct 2012 01:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-363150</guid>
		<description><![CDATA[[...] blog post so I did my best to come up with one. Here is the reason why? I wrote a blog post earlier SQL SERVER – Find First Non-Numeric Character from String. One of the questions was that how that blog can be useful in real life scenario. This blog post is [...]]]></description>
		<content:encoded><![CDATA[<p>[...] blog post so I did my best to come up with one. Here is the reason why? I wrote a blog post earlier SQL SERVER – Find First Non-Numeric Character from String. One of the questions was that how that blog can be useful in real life scenario. This blog post is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bradford</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-362103</link>
		<dc:creator><![CDATA[Eric Bradford]]></dc:creator>
		<pubDate>Fri, 19 Oct 2012 20:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-362103</guid>
		<description><![CDATA[Charindex seems to do this a bit faster :

SELECT CHARINDEX ( &#039;%[^0-9]%&#039;,Col1 ) &#039;Position of NonNumeric Character&#039;,
SUBSTRING(Col1,CHARINDEX ( &#039;%[^0-9]%&#039;,Col1 ),1) &#039;NonNumeric Character&#039;,
Col1 &#039;Original Character&#039;
FROM MyTable t1


I tried it on a larger recordset:

SET STATISTICS TIME ON 

SELECT PATINDEX(&#039;%[^0-9]%&#039;,t1.name) &#039;Position of NonNumeric Character&#039;,
SUBSTRING(t1.name,PATINDEX(&#039;%[^0-9]%&#039;,t1.name),1) &#039;NonNumeric Character&#039;,
t1.name &#039;Original Character&#039;
FROM sys.all_columns t1
ORDER BY object_id

SELECT CHARINDEX ( &#039;%[^0-9]%&#039;,t1.NAME ) &#039;Position of NonNumeric Character&#039;,
SUBSTRING(t1.name,CHARINDEX ( &#039;%[^0-9]%&#039;,t1.NAME ),1) &#039;NonNumeric Character&#039;,
t1.name &#039;Original Character&#039;
FROM sys.all_columns t1
ORDER BY object_id]]></description>
		<content:encoded><![CDATA[<p>Charindex seems to do this a bit faster :</p>
<p>SELECT CHARINDEX ( &#8216;%[^0-9]%&#8217;,Col1 ) &#8216;Position of NonNumeric Character&#8217;,<br />
SUBSTRING(Col1,CHARINDEX ( &#8216;%[^0-9]%&#8217;,Col1 ),1) &#8216;NonNumeric Character&#8217;,<br />
Col1 &#8216;Original Character&#8217;<br />
FROM MyTable t1</p>
<p>I tried it on a larger recordset:</p>
<p>SET STATISTICS TIME ON </p>
<p>SELECT PATINDEX(&#8216;%[^0-9]%&#8217;,t1.name) &#8216;Position of NonNumeric Character&#8217;,<br />
SUBSTRING(t1.name,PATINDEX(&#8216;%[^0-9]%&#8217;,t1.name),1) &#8216;NonNumeric Character&#8217;,<br />
t1.name &#8216;Original Character&#8217;<br />
FROM sys.all_columns t1<br />
ORDER BY object_id</p>
<p>SELECT CHARINDEX ( &#8216;%[^0-9]%&#8217;,t1.NAME ) &#8216;Position of NonNumeric Character&#8217;,<br />
SUBSTRING(t1.name,CHARINDEX ( &#8216;%[^0-9]%&#8217;,t1.NAME ),1) &#8216;NonNumeric Character&#8217;,<br />
t1.name &#8216;Original Character&#8217;<br />
FROM sys.all_columns t1<br />
ORDER BY object_id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjay Monpara</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-360239</link>
		<dc:creator><![CDATA[Sanjay Monpara]]></dc:creator>
		<pubDate>Mon, 15 Oct 2012 10:00:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-360239</guid>
		<description><![CDATA[Harsh, You are right]]></description>
		<content:encoded><![CDATA[<p>Harsh, You are right</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rahul Bhatti</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-360180</link>
		<dc:creator><![CDATA[Rahul Bhatti]]></dc:creator>
		<pubDate>Mon, 15 Oct 2012 07:09:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-360180</guid>
		<description><![CDATA[Dear Mr. Pinal,  I have problem of using PIVOT in query. IT gives error message to set database compatibility.  Waiting for your reply.]]></description>
		<content:encoded><![CDATA[<p>Dear Mr. Pinal,</p>
<p> I have problem of using PIVOT in query. IT gives error message to set database compatibility.</p>
<p> Waiting for your reply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harsh</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-360138</link>
		<dc:creator><![CDATA[Harsh]]></dc:creator>
		<pubDate>Mon, 15 Oct 2012 05:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-360138</guid>
		<description><![CDATA[These first 2 solutions of %[a-z] &amp; %[a-z,A-Z]% will work in given example. 
But, it will not work in case of any special character is there, because it is returning first alphabet character of string]]></description>
		<content:encoded><![CDATA[<p>These first 2 solutions of %[a-z] &amp; %[a-z,A-Z]% will work in given example.<br />
But, it will not work in case of any special character is there, because it is returning first alphabet character of string</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nirav</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-360125</link>
		<dc:creator><![CDATA[nirav]]></dc:creator>
		<pubDate>Mon, 15 Oct 2012 04:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-360125</guid>
		<description><![CDATA[SELECT PATINDEX(&#039;%[a-z,A-Z]%&#039;,Col1) &#039;Position of NonNumeric Character&#039;,
PATINDEX(&#039;%[^0-9]%&#039;,Col1) &#039;Position of NonNumeric Character&#039;,
SUBSTRING(Col1,PATINDEX(&#039;%[^0-9]%&#039;,Col1),1) &#039;NonNumeric Character&#039;,
Col1 &#039;Original Character&#039;
FROM MyTable]]></description>
		<content:encoded><![CDATA[<p>SELECT PATINDEX(&#8216;%[a-z,A-Z]%&#8217;,Col1) &#8216;Position of NonNumeric Character&#8217;,<br />
PATINDEX(&#8216;%[^0-9]%&#8217;,Col1) &#8216;Position of NonNumeric Character&#8217;,<br />
SUBSTRING(Col1,PATINDEX(&#8216;%[^0-9]%&#8217;,Col1),1) &#8216;NonNumeric Character&#8217;,<br />
Col1 &#8216;Original Character&#8217;<br />
FROM MyTable</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Muhammad Imran</title>
		<link>http://blog.sqlauthority.com/2012/10/14/sql-server-find-first-non-numeric-character-from-string/#comment-359714</link>
		<dc:creator><![CDATA[Muhammad Imran]]></dc:creator>
		<pubDate>Sun, 14 Oct 2012 04:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=21179#comment-359714</guid>
		<description><![CDATA[One more option is :

SELECT PATINDEX(&#039;%[a-z]%&#039;,Col1) &#039;Position of NonNumeric Character&#039;,
SUBSTRING(Col1,PATINDEX(&#039;%[a-z]%&#039;,Col1),1) &#039;NonNumeric Character&#039;,
Col1 &#039;Original Character&#039;
FROM MyTable]]></description>
		<content:encoded><![CDATA[<p>One more option is :</p>
<p>SELECT PATINDEX(&#8216;%[a-z]%&#8217;,Col1) &#8216;Position of NonNumeric Character&#8217;,<br />
SUBSTRING(Col1,PATINDEX(&#8216;%[a-z]%&#8217;,Col1),1) &#8216;NonNumeric Character&#8217;,<br />
Col1 &#8216;Original Character&#8217;<br />
FROM MyTable</p>
]]></content:encoded>
	</item>
</channel>
</rss>
