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
 Separating words in a field

Author  Topic 

insanepaul
Posting Yak Master

178 Posts

Posted - 2009-02-03 : 06:40:47
I have a select command that displays 6 columns below. The sixth column i need to use the referenced names not the ID. So in the select command I would insert another select command as shown just below the table to get their corresponding names.

However, when looking at the luoption table at the bottom, I notice that there are 1 or more words separated by a pipe. How would I display this on screen? I'm thinking I should get the corresponding items anyway using the select statement below then in my C# code separate the words from the pipe then populate a combo box. Is this the way it's done?


1 Title Project Name 1 TextArea 0
2 Descri Project State 1 TextArea 0
3 Owner Project Leader 1 SpecialList 0
9 Status RAG 1 Combo 385
15 LastSave 1 Special 305

(SELECT sname FROM luoption WHERE (loptionid = strToolinfo.loptionid)) as Name

Table luOption
ID sName
0 Text Entry
385 |A = Go|B = Modify|C = Wait|D = Kill
305 |Product 1|Product 2|Product 3|Product 4|Product 5

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-03 : 08:43:51
you can do it in sql itself. b/w are you using sql 2005? then see below

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=116918
Go to Top of Page
   

- Advertisement -