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
 General SQL Server Forums
 New to SQL Server Programming
 string parsing

Author  Topic 

craigwg
Posting Yak Master

154 Posts

Posted - 2011-01-17 : 16:59:29
I need to parse a number out of the following:

1647|113|27|3149|19453

Specifically I'm looking for 3149, the 4th set of digits.

The problem is that each set of digits can be a different length. I know there's a way to do with this substring and charindex nested inside each other multiple times but I can't figure it out.

I'm looking for the answer, but also for a methodology to apply so I can do this on my own in the future.

Thanks

Craig Greenwood

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-01-17 : 17:36:12
see this thread http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033

You can use fnParseList or fnParseString depending on how do you want the result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -