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 2000 Forums
 SQL Server Development (2000)
 Tokenizing a String

Author  Topic 

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-29 : 22:35:30
hello all,

i am trying to tokenize a varchar.

wondering if anyone knows an example of implementing a string tokenizer
with delimiters in sql server? cant seem to find a good solution


------------------------------------------------------------------

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Rich Cook

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-05-29 : 22:44:30
http://www.nigelrivett.net/SQLTsql/ParseCSVString.html

Does that help ?


Damian
Ita erat quando hic adveni.
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-29 : 22:56:16
kinda I have seen examples like this

however my string is a math function so it looks like word1 + word 2 * word 3 * 5 * word 4

which makes it much more difficult as there is no common operator to split the strings up

i am thinking the way i can do it is try search for ascii code for the operators and split up the words/numbers that way

at the moment seems like the only way i can think to do it

------------------------------------------------------------------

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Rich Cook
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2005-05-29 : 23:00:39
Sounds like you're using the wrong tool for the job.


Damian
Ita erat quando hic adveni.
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-05-29 : 23:07:55
yeh i know :( i was hoping there would be a nice way to do it in sql server bit of overhead i have to do in order to get it to run in my app
oh well :) thanks anyways

------------------------------------------------------------------

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Rich Cook
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-05-30 : 02:26:19
An implementation of an Expression Evaluator in SQL:
[url]http://www.sqlservercentral.com/scripts/contributions/1191.asp[/url]

rockmoose
Go to Top of Page
   

- Advertisement -