<?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; UDF &#8211; Function to Parse AlphaNumeric Characters from String</title>
	<atom:link href="http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: salisha</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56806</link>
		<dc:creator>salisha</dc:creator>
		<pubDate>Tue, 20 Oct 2009 08:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56806</guid>
		<description>Its Very Good. Thank you</description>
		<content:encoded><![CDATA[<p>Its Very Good. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Celio</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56141</link>
		<dc:creator>Celio</dc:creator>
		<pubDate>Thu, 24 Sep 2009 20:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56141</guid>
		<description>Actually you have a great knowledge, congratulations!</description>
		<content:encoded><![CDATA[<p>Actually you have a great knowledge, congratulations!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andre Pavini</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56140</link>
		<dc:creator>Andre Pavini</dc:creator>
		<pubDate>Thu, 24 Sep 2009 20:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-56140</guid>
		<description>Dear,

Tanks a lot! Perfect!</description>
		<content:encoded><![CDATA[<p>Dear,</p>
<p>Tanks a lot! Perfect!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-55656</link>
		<dc:creator>Ashish</dc:creator>
		<pubDate>Mon, 07 Sep 2009 06:20:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-55656</guid>
		<description>@enrico
i just write this and good to see that it also working in SQL 2000 hope will be helpful to you,,,

DECLARE @Test TABLE (Data VARCHAR(10))
INSERT INTO @test
SELECT &#039;INV0096&#039;
UNION ALL
SELECT &#039;INV0097&#039;
UNION ALL
SELECT &#039;INV0099&#039;
UNION ALL
SELECT &#039;INV0100&#039;
UNION ALL
SELECT &#039;INV0102&#039;
UNION ALL
SELECT &#039;INV0103&#039;
UNION ALL
SELECT &#039;INV0106&#039;
UNION ALL
SELECT &#039;INV0110&#039;



select number from master..spt_values  where 
number not in (select right(data,4) from @test) and 
number between (select min(right(data,4)) from @test) 
and (select max(right(data,4)) from @test) and TYPE=&#039;P&#039;</description>
		<content:encoded><![CDATA[<p>@enrico<br />
i just write this and good to see that it also working in SQL 2000 hope will be helpful to you,,,</p>
<p>DECLARE @Test TABLE (Data VARCHAR(10))<br />
INSERT INTO @test<br />
SELECT &#8216;INV0096&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0097&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0099&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0100&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0102&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0103&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0106&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0110&#8242;</p>
<p>select number from master..spt_values  where<br />
number not in (select right(data,4) from @test) and<br />
number between (select min(right(data,4)) from @test)<br />
and (select max(right(data,4)) from @test) and TYPE=&#8217;P&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enrico</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54798</link>
		<dc:creator>enrico</dc:creator>
		<pubDate>Wed, 12 Aug 2009 22:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54798</guid>
		<description>Hi Tejas,


Thanks for that mate!

I really appreciate the assistance!




Thanks Pinal for putting up such an awesome site!!


Regards,

enrico</description>
		<content:encoded><![CDATA[<p>Hi Tejas,</p>
<p>Thanks for that mate!</p>
<p>I really appreciate the assistance!</p>
<p>Thanks Pinal for putting up such an awesome site!!</p>
<p>Regards,</p>
<p>enrico</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54770</link>
		<dc:creator>Tejas Shah</dc:creator>
		<pubDate>Wed, 12 Aug 2009 06:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54770</guid>
		<description>@Enrico,

I developed this script for SQL 2000.

In this script, there is limitation, that it will give you only one missing value.

If we miss 104,105 (means more than one value we missed) then it will return only one.

DECLARE @Test TABLE (Data VARCHAR(10))
INSERT INTO @test
SELECT &#039;INV0096&#039;
UNION ALL
SELECT &#039;INV0097&#039;
UNION ALL
SELECT &#039;INV0099&#039;
UNION ALL
SELECT &#039;INV0100&#039;
UNION ALL
SELECT &#039;INV0102&#039;
UNION ALL
SELECT &#039;INV0103&#039;
UNION ALL
SELECT &#039;INV0106&#039;
UNION ALL
SELECT &#039;INV0110&#039;

CREATE TABLE #test (ID INT IDENTITY, RowID INT)
INSERT INTO #test(RowID)
SELECT CAST(RIGHT(Data,4) AS INT) As RowID
FROM @Test
ORDER BY CAST(RIGHT(Data,4) AS INT)

SELECT	t1.RowID + 1 
FROM	#test t1
INNER JOIN #test t2 ON t1.ID + 1 = t2.ID
	AND t1.RowID + 1  t2.RowID

DROP TABLE #test


I will try to make it as I made for SQL 2005, but I think it will take time.

Let me know if it helps you. 

Thanks,

Tejas
(SQLYOGA.com)</description>
		<content:encoded><![CDATA[<p>@Enrico,</p>
<p>I developed this script for SQL 2000.</p>
<p>In this script, there is limitation, that it will give you only one missing value.</p>
<p>If we miss 104,105 (means more than one value we missed) then it will return only one.</p>
<p>DECLARE @Test TABLE (Data VARCHAR(10))<br />
INSERT INTO @test<br />
SELECT &#8216;INV0096&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0097&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0099&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0100&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0102&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0103&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0106&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0110&#8242;</p>
<p>CREATE TABLE #test (ID INT IDENTITY, RowID INT)<br />
INSERT INTO #test(RowID)<br />
SELECT CAST(RIGHT(Data,4) AS INT) As RowID<br />
FROM @Test<br />
ORDER BY CAST(RIGHT(Data,4) AS INT)</p>
<p>SELECT	t1.RowID + 1<br />
FROM	#test t1<br />
INNER JOIN #test t2 ON t1.ID + 1 = t2.ID<br />
	AND t1.RowID + 1  t2.RowID</p>
<p>DROP TABLE #test</p>
<p>I will try to make it as I made for SQL 2005, but I think it will take time.</p>
<p>Let me know if it helps you. </p>
<p>Thanks,</p>
<p>Tejas<br />
(SQLYOGA.com)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enrico</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54754</link>
		<dc:creator>enrico</dc:creator>
		<pubDate>Tue, 11 Aug 2009 22:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54754</guid>
		<description>Hi Brian/Tejas,

Thanks for that!
That worked beautiful on SQL2005! You guys are awesome.

On the off chance, is there a way to get the same result on SQL2000?

I definitely appreciate your time guys. I can&#039;t even begin to express my thanks for helping me out on this.

I&#039;ll look forward to your thoughts on the same issue for SQL2000.


Thanks again.

Regards,

enrico</description>
		<content:encoded><![CDATA[<p>Hi Brian/Tejas,</p>
<p>Thanks for that!<br />
That worked beautiful on SQL2005! You guys are awesome.</p>
<p>On the off chance, is there a way to get the same result on SQL2000?</p>
<p>I definitely appreciate your time guys. I can&#8217;t even begin to express my thanks for helping me out on this.</p>
<p>I&#8217;ll look forward to your thoughts on the same issue for SQL2000.</p>
<p>Thanks again.</p>
<p>Regards,</p>
<p>enrico</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54736</link>
		<dc:creator>Tejas Shah</dc:creator>
		<pubDate>Tue, 11 Aug 2009 12:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54736</guid>
		<description>@enrico,

You can find Missing values with Recursive CTE as follwing, It will work only with SQL 2005 and above.

DECLARE @Test TABLE (Data VARCHAR(10))
INSERT INTO @test
SELECT &#039;INV0096&#039;
UNION ALL
SELECT &#039;INV0097&#039;
UNION ALL
SELECT &#039;INV0099&#039;
UNION ALL
SELECT &#039;INV0100&#039;
UNION ALL
SELECT &#039;INV0102&#039;
UNION ALL
SELECT &#039;INV0103&#039;
UNION ALL
SELECT &#039;INV0106&#039;
UNION ALL
SELECT &#039;INV0110&#039;

;with cte1 as(
	SELECT	CAST(RIGHT(Data,4) AS INT) As RowID
	FROM	@Test
), Missing as(
	SELECT	MIN(RowID) AS MissNum, 
			MAX(RowID) AS MaxID
	FROM Cte1		
	UNION ALL
	SELECT	MissNum + 1, 
			MaxID 
	FROM	Missing
	WHERE	MissNum &lt; MaxID
)
SELECT missnum
FROM Missing
LEFT JOIN cte1 tt on tt.Rowid = Missing.MissNum
WHERE tt.Rowid is NULL
OPTION (MAXRECURSION 0); 

Let us know if it helps you.

Thanks,

Tejas
(SQLYoga.com)</description>
		<content:encoded><![CDATA[<p>@enrico,</p>
<p>You can find Missing values with Recursive CTE as follwing, It will work only with SQL 2005 and above.</p>
<p>DECLARE @Test TABLE (Data VARCHAR(10))<br />
INSERT INTO @test<br />
SELECT &#8216;INV0096&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0097&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0099&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0100&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0102&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0103&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0106&#8242;<br />
UNION ALL<br />
SELECT &#8216;INV0110&#8242;</p>
<p>;with cte1 as(<br />
	SELECT	CAST(RIGHT(Data,4) AS INT) As RowID<br />
	FROM	@Test<br />
), Missing as(<br />
	SELECT	MIN(RowID) AS MissNum,<br />
			MAX(RowID) AS MaxID<br />
	FROM Cte1<br />
	UNION ALL<br />
	SELECT	MissNum + 1,<br />
			MaxID<br />
	FROM	Missing<br />
	WHERE	MissNum &lt; MaxID<br />
)<br />
SELECT missnum<br />
FROM Missing<br />
LEFT JOIN cte1 tt on tt.Rowid = Missing.MissNum<br />
WHERE tt.Rowid is NULL<br />
OPTION (MAXRECURSION 0); </p>
<p>Let us know if it helps you.</p>
<p>Thanks,</p>
<p>Tejas<br />
(SQLYoga.com)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54734</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Tue, 11 Aug 2009 11:51:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54734</guid>
		<description>@enrico


WITH
	Data(Datum)
AS
	(
	 SELECT &#039;INV0096&#039; UNION ALL
	 SELECT &#039;INV0097&#039; UNION ALL
	 SELECT &#039;INV0099&#039; UNION ALL
	 SELECT &#039;INV0100&#039; UNION ALL
	 SELECT &#039;INV0102&#039; UNION ALL
	 SELECT &#039;INV0103&#039;
	),
	CTE
AS
	(
	 SELECT
			CAST(SUBSTRING(MIN(Datum), 4, 4) AS INT) Start,
			CAST(SUBSTRING(MAX(Datum), 4, 4) AS INT) Finish
	 FROM
			Data
	 UNION ALL
	 SELECT
			Start	+ 1,
			Finish
	 FROM
			CTE
	 WHERE
			Start &lt; Finish
	)
SELECT
		Common.Formatted
FROM
		CTE
		CROSS APPLY(SELECT &#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)) Common(Formatted)
WHERE
		NOT EXISTS
		(
		 SELECT
				*
		 FROM
				Data
		 WHERE
				Data.Datum = Common.Formatted
		)
OPTION
		(MAXRECURSION 0);

The CROSS APPLY is just nice, but not required. Without it, the query is very similar:


WITH
	Data(Datum)
AS
	(
	 SELECT &#039;INV0096&#039; UNION ALL
	 SELECT &#039;INV0097&#039; UNION ALL
	 SELECT &#039;INV0099&#039; UNION ALL
	 SELECT &#039;INV0100&#039; UNION ALL
	 SELECT &#039;INV0102&#039; UNION ALL
	 SELECT &#039;INV0103&#039;
	),
	CTE
AS
	(
	 SELECT
			CAST(SUBSTRING(MIN(Datum), 4, 4) AS INT) Start,
			CAST(SUBSTRING(MAX(Datum), 4, 4) AS INT) Finish
	 FROM
			Data
	 UNION ALL
	 SELECT
			Start	+ 1,
			Finish
	 FROM
			CTE
	 WHERE
			Start &lt; Finish
	)
SELECT
		&#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)
FROM
		CTE
WHERE
		NOT EXISTS
		(
		 SELECT
				*
		 FROM
				Data
		 WHERE
				Data.Datum = &#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)
		)
OPTION
		(MAXRECURSION 0);</description>
		<content:encoded><![CDATA[<p>@enrico</p>
<p>WITH<br />
	Data(Datum)<br />
AS<br />
	(<br />
	 SELECT &#8216;INV0096&#8242; UNION ALL<br />
	 SELECT &#8216;INV0097&#8242; UNION ALL<br />
	 SELECT &#8216;INV0099&#8242; UNION ALL<br />
	 SELECT &#8216;INV0100&#8242; UNION ALL<br />
	 SELECT &#8216;INV0102&#8242; UNION ALL<br />
	 SELECT &#8216;INV0103&#8242;<br />
	),<br />
	CTE<br />
AS<br />
	(<br />
	 SELECT<br />
			CAST(SUBSTRING(MIN(Datum), 4, 4) AS INT) Start,<br />
			CAST(SUBSTRING(MAX(Datum), 4, 4) AS INT) Finish<br />
	 FROM<br />
			Data<br />
	 UNION ALL<br />
	 SELECT<br />
			Start	+ 1,<br />
			Finish<br />
	 FROM<br />
			CTE<br />
	 WHERE<br />
			Start &lt; Finish<br />
	)<br />
SELECT<br />
		Common.Formatted<br />
FROM<br />
		CTE<br />
		CROSS APPLY(SELECT &#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)) Common(Formatted)<br />
WHERE<br />
		NOT EXISTS<br />
		(<br />
		 SELECT<br />
				*<br />
		 FROM<br />
				Data<br />
		 WHERE<br />
				Data.Datum = Common.Formatted<br />
		)<br />
OPTION<br />
		(MAXRECURSION 0);</p>
<p>The CROSS APPLY is just nice, but not required. Without it, the query is very similar:</p>
<p>WITH<br />
	Data(Datum)<br />
AS<br />
	(<br />
	 SELECT &#039;INV0096&#039; UNION ALL<br />
	 SELECT &#039;INV0097&#039; UNION ALL<br />
	 SELECT &#039;INV0099&#039; UNION ALL<br />
	 SELECT &#039;INV0100&#039; UNION ALL<br />
	 SELECT &#039;INV0102&#039; UNION ALL<br />
	 SELECT &#039;INV0103&#039;<br />
	),<br />
	CTE<br />
AS<br />
	(<br />
	 SELECT<br />
			CAST(SUBSTRING(MIN(Datum), 4, 4) AS INT) Start,<br />
			CAST(SUBSTRING(MAX(Datum), 4, 4) AS INT) Finish<br />
	 FROM<br />
			Data<br />
	 UNION ALL<br />
	 SELECT<br />
			Start	+ 1,<br />
			Finish<br />
	 FROM<br />
			CTE<br />
	 WHERE<br />
			Start &lt; Finish<br />
	)<br />
SELECT<br />
		&#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)<br />
FROM<br />
		CTE<br />
WHERE<br />
		NOT EXISTS<br />
		(<br />
		 SELECT<br />
				*<br />
		 FROM<br />
				Data<br />
		 WHERE<br />
				Data.Datum = &#039;INV&#039; + RIGHT(&#039;0000&#039; + CAST(Start AS VARCHAR(4)), 4)<br />
		)<br />
OPTION<br />
		(MAXRECURSION 0);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enrico</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54724</link>
		<dc:creator>enrico</dc:creator>
		<pubDate>Tue, 11 Aug 2009 07:47:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54724</guid>
		<description>Hi Pinal/Folks,

Can anyone please help me? I am stunned at this one.

Let&#039;s say I have the following records:

INV0096
INV0097
INV0099
INV0100
INV0102
INV0103

How can I generate a SQL Script that will show me the gaps in the sequence?

In such a way that the results will give me INV0098 and INV0101.
Or even just the number 98, and 101.

Thank you so much for your time.

Best regards,

Enrico</description>
		<content:encoded><![CDATA[<p>Hi Pinal/Folks,</p>
<p>Can anyone please help me? I am stunned at this one.</p>
<p>Let&#8217;s say I have the following records:</p>
<p>INV0096<br />
INV0097<br />
INV0099<br />
INV0100<br />
INV0102<br />
INV0103</p>
<p>How can I generate a SQL Script that will show me the gaps in the sequence?</p>
<p>In such a way that the results will give me INV0098 and INV0101.<br />
Or even just the number 98, and 101.</p>
<p>Thank you so much for your time.</p>
<p>Best regards,</p>
<p>Enrico</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54528</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Thu, 06 Aug 2009 12:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54528</guid>
		<description>@Lori

WITH
	Data(String)
AS
	(
	 SELECT &#039;287PHY 10102 PHY 10106 BIO 32001 BIO 33501&#039;	UNION ALL
	 SELECT &#039;4568PHY 10102 PHY 10106 BIO 32001 BIO 33501&#039;	UNION ALL
	 SELECT &#039;32891PHY 10102 PHY 10106 BIO 32001 BIO 33501&#039;
	)
SELECT
		SUBSTRING
		(
		 String,
		 1,
		 PATINDEX(&#039;%[^0-9]%&#039;, String) - 1
		)
FROM
		Data;</description>
		<content:encoded><![CDATA[<p>@Lori</p>
<p>WITH<br />
	Data(String)<br />
AS<br />
	(<br />
	 SELECT &#8216;287PHY 10102 PHY 10106 BIO 32001 BIO 33501&#8242;	UNION ALL<br />
	 SELECT &#8216;4568PHY 10102 PHY 10106 BIO 32001 BIO 33501&#8242;	UNION ALL<br />
	 SELECT &#8216;32891PHY 10102 PHY 10106 BIO 32001 BIO 33501&#8242;<br />
	)<br />
SELECT<br />
		SUBSTRING<br />
		(<br />
		 String,<br />
		 1,<br />
		 PATINDEX(&#8216;%[^0-9]%&#8217;, String) &#8211; 1<br />
		)<br />
FROM<br />
		Data;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54527</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Thu, 06 Aug 2009 12:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54527</guid>
		<description>@Adam

 Here is a quick CTE approach to putting each as a separate record.

WITH
	Data(String) AS (SELECT &#039;ABC&quot;_I+{D[]}4&#124;:e;&quot;&quot;5,/?6&#039;),
	CTE
AS
	(
	 SELECT
			0			X_Current,
			LEN(String)	X_Max,
			&#039;&#039;			Digit
	 FROM
			Data
	 UNION ALL
	 SELECT
			CTE.X_Current + 1,
			CTE.X_Max,
			SUBSTRING(Data.String, CTE.X_Current, 1)
	 FROM
			CTE,
			Data
	 WHERE
			CTE.X_Current &lt;= CTE.X_Max
	)
SELECT
		Digit
FROM
		CTE
WHERE
		Digit LIKE &#039;[0-9]&#039;
OPTION
		(MAXRECURSION 0);</description>
		<content:encoded><![CDATA[<p>@Adam</p>
<p> Here is a quick CTE approach to putting each as a separate record.</p>
<p>WITH<br />
	Data(String) AS (SELECT &#8216;ABC&#8221;_I+{D[]}4|:e;&#8221;"5,/?6&#8242;),<br />
	CTE<br />
AS<br />
	(<br />
	 SELECT<br />
			0			X_Current,<br />
			LEN(String)	X_Max,<br />
			&#8221;			Digit<br />
	 FROM<br />
			Data<br />
	 UNION ALL<br />
	 SELECT<br />
			CTE.X_Current + 1,<br />
			CTE.X_Max,<br />
			SUBSTRING(Data.String, CTE.X_Current, 1)<br />
	 FROM<br />
			CTE,<br />
			Data<br />
	 WHERE<br />
			CTE.X_Current &lt;= CTE.X_Max<br />
	)<br />
SELECT<br />
		Digit<br />
FROM<br />
		CTE<br />
WHERE<br />
		Digit LIKE &#039;[0-9]&#039;<br />
OPTION<br />
		(MAXRECURSION 0);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lori</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54477</link>
		<dc:creator>Lori</dc:creator>
		<pubDate>Wed, 05 Aug 2009 15:40:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54477</guid>
		<description>I need to parse out the first set up numbers in a column before the first character in a string:
example
287PHY 10102 PHY 10106 BIO 32001 BIO 33501 
4568PHY 10102 PHY 10106 BIO 32001 BIO 33501 
32891PHY 10102 PHY 10106 BIO 32001 BIO 33501 

I need to parse out the
287
4568
32891

in a separate column.
Can someone help me out?
Thanks in advance.</description>
		<content:encoded><![CDATA[<p>I need to parse out the first set up numbers in a column before the first character in a string:<br />
example<br />
287PHY 10102 PHY 10106 BIO 32001 BIO 33501<br />
4568PHY 10102 PHY 10106 BIO 32001 BIO 33501<br />
32891PHY 10102 PHY 10106 BIO 32001 BIO 33501 </p>
<p>I need to parse out the<br />
287<br />
4568<br />
32891</p>
<p>in a separate column.<br />
Can someone help me out?<br />
Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54276</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Thu, 30 Jul 2009 16:41:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-54276</guid>
		<description>how can i get all numeric values as numeric value in a table ?

i mean, the result set should be in a table format not scalar varchar value.

your sample statement:
SELECT dbo.UDF_ParseAlphaChars(&#039;ABC”_I+{D[]}4&#124;:e;””5,/?6&#039;)

result should be:

Number
4
5
6


Thanks</description>
		<content:encoded><![CDATA[<p>how can i get all numeric values as numeric value in a table ?</p>
<p>i mean, the result set should be in a table format not scalar varchar value.</p>
<p>your sample statement:<br />
SELECT dbo.UDF_ParseAlphaChars(&#8216;ABC”_I+{D[]}4|:e;””5,/?6&#8242;)</p>
<p>result should be:</p>
<p>Number<br />
4<br />
5<br />
6</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gurpreet</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-53599</link>
		<dc:creator>Gurpreet</dc:creator>
		<pubDate>Fri, 10 Jul 2009 09:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-53599</guid>
		<description>WHILE @IncorrectCharLoc &gt; 0
BEGIN
SET @string = STUFF(@string, @IncorrectCharLoc, 1, &#039;&#039;)
SET @IncorrectCharLoc = PATINDEX(&#039;%[^0-9]%&#039;, @string)
END</description>
		<content:encoded><![CDATA[<p>WHILE @IncorrectCharLoc &gt; 0<br />
BEGIN<br />
SET @string = STUFF(@string, @IncorrectCharLoc, 1, &#8221;)<br />
SET @IncorrectCharLoc = PATINDEX(&#8216;%[^0-9]%&#8217;, @string)<br />
END</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wael</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-52359</link>
		<dc:creator>Wael</dc:creator>
		<pubDate>Mon, 25 May 2009 08:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-52359</guid>
		<description>Hey,

I have a column called runtime where it has the runtime of movies, its a TEXT field, an most of the values inside are in this format:
124m or 1546mins or 92 mins

so how can i strip only the numbers from there??

i really need ur help and thx alot in advance</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>I have a column called runtime where it has the runtime of movies, its a TEXT field, an most of the values inside are in this format:<br />
124m or 1546mins or 92 mins</p>
<p>so how can i strip only the numbers from there??</p>
<p>i really need ur help and thx alot in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51466</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Fri, 01 May 2009 17:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51466</guid>
		<description>Thanx Pinal.

And now that i changed my DNS records, i am receiving email from your website. Silly bug in Exchange with CNAMEs.</description>
		<content:encoded><![CDATA[<p>Thanx Pinal.</p>
<p>And now that i changed my DNS records, i am receiving email from your website. Silly bug in Exchange with CNAMEs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51465</link>
		<dc:creator>pinaldave</dc:creator>
		<pubDate>Fri, 01 May 2009 17:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51465</guid>
		<description>Brian,

Thanks very good solution.

Regards,
Pinal</description>
		<content:encoded><![CDATA[<p>Brian,</p>
<p>Thanks very good solution.</p>
<p>Regards,<br />
Pinal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51460</link>
		<dc:creator>Brian Tkatch</dc:creator>
		<pubDate>Fri, 01 May 2009 12:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51460</guid>
		<description>@Gates

WITH
	EG([Employee Name])
AS
	(
	 SELECT &#039;Billgates&#039;	UNION ALL
	 SELECT &#039;George&#039;	UNION ALL
	 SELECT &#039;A1dam&#039;		UNION ALL
	 SELECT &#039;Gem9ini&#039;
	)
SELECT
	[Employee Name]
FROM
	EG
WHERE
	[Employee Name] LIKE &#039;%[0-9]%&#039;</description>
		<content:encoded><![CDATA[<p>@Gates</p>
<p>WITH<br />
	EG([Employee Name])<br />
AS<br />
	(<br />
	 SELECT &#8216;Billgates&#8217;	UNION ALL<br />
	 SELECT &#8216;George&#8217;	UNION ALL<br />
	 SELECT &#8216;A1dam&#8217;		UNION ALL<br />
	 SELECT &#8216;Gem9ini&#8217;<br />
	)<br />
SELECT<br />
	[Employee Name]<br />
FROM<br />
	EG<br />
WHERE<br />
	[Employee Name] LIKE &#8216;%[0-9]%&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gates</title>
		<link>http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51456</link>
		<dc:creator>Gates</dc:creator>
		<pubDate>Fri, 01 May 2009 08:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/05/13/sql-server-udf-function-to-parse-alphanumeric-characters-from-string/#comment-51456</guid>
		<description>To aLL,

I have one table TABLE! , which contains one column named “EMPLOYEE NAME”.
There are various values inside it.
i want to check every field of EMPLOYEE NAME and find out if there is any Numeric Value inside.

EG.
EMPLOYEE NAME
Billgates
George
A1dam –Here 1 is present in between
Gem9ini –Here 9 is present in between

i want to identify this types of name which contains the numeric value in the field.</description>
		<content:encoded><![CDATA[<p>To aLL,</p>
<p>I have one table TABLE! , which contains one column named “EMPLOYEE NAME”.<br />
There are various values inside it.<br />
i want to check every field of EMPLOYEE NAME and find out if there is any Numeric Value inside.</p>
<p>EG.<br />
EMPLOYEE NAME<br />
Billgates<br />
George<br />
A1dam –Here 1 is present in between<br />
Gem9ini –Here 9 is present in between</p>
<p>i want to identify this types of name which contains the numeric value in the field.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
