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)
 split

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2007-04-20 : 10:19:36
How is it possible to separate a varchar(50) value such as 'WTI NYMEX:AL LME'
into 'WTI NYMEX' and 'AL LME'
i.e. separated by :
Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-20 : 10:24:37
[code]select parsename(replace('WTI NYMEX:AL LME', ':', '.'),2), parsename(replace('WTI NYMEX:AL LME', ':', '.'),1)[/code]

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

Kristen
Test

22859 Posts

Posted - 2007-04-20 : 10:49:01
Are there only two "components", or an unlimited number?

If only two then go with Harsh's answer

Kristen
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-21 : 00:12:25
use the function here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033



KH

Go to Top of Page
   

- Advertisement -