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
 Transact-SQL (2000)
 Split String

Author  Topic 

iloveorangesoda
Starting Member

30 Posts

Posted - 2008-02-26 : 09:46:54
I have a table that holds a list of exceptions in one field i.e. Message. This field might look like this: One Rejected, Two Rejected, Three Rejects, etc... What I want to do is split this string by comma so that I can output the string on different rows in a front end application.

e.g
One Rejected
Two Rejected
Three Rejected

Can anyone advise how I would do this?

My current sproc for getting information out looks like this

SELECT Id,
Type AS [Type],
Number,
Message,
DateActioned,
ActionedBy
FROM t_Exception
WHERE DateActioned IS NULL

ORDER BY Number ASC

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-26 : 09:50:38
See this: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-02-26 : 11:03:36
Alternatively if you want to show data in front end application, use split function there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -