Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Hi my parser

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2008-09-12 : 14:26:00
CREATE PROCEDURE [dbo].[usp_parser]
@string NVARCHAR(MAX)
AS

SELECT @string = ''''+REPLACE(@string,'/',''' ))AS ROWS UNION ALL SELECT RTRIM(LTRIM(''')+''''
SELECT @string = 'SELECT RTRIM(LTRIM( ' + @string + ')) AS ROWS'
EXEC SP_EXECUTESQL @string

--
exec usp_parser '6.5/7.0/2000/2005/2008'
-------
ROWS
----
6.5
7.0
2000
2005
2008


Sanjeev Shrestha
12/17/1971

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-12 : 14:27:41
You forgot the most important part when posting a new thread. What is your question?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-12 : 16:26:54
He seeks the Holy Grail.

Boycotted Beijing Olympics 2008
Go to Top of Page
   

- Advertisement -