Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I wanna generate a words list as suggestion that is splited based on Space, Comma, dot or any other special symbols from a particular Column of table in sql server.

Example -

Single Column Value show here -

Preferred Medicine
-------------------
Abacavir Sulfate, Abarelix, Abatacept, Abciximab.
Cabergoline  Caduet Cafcit Cafergot, Caffeine Citrate
Nabi-HB, Nabumetone, Nadolol



Result Should be like this -

Medicine Name
-------------------
Abacavir
Sulfate
Abarelix
Abatacept
Abciximab
Cabergoline
Caduet 
Cafcit 
Cafergot
Caffeine 
Citrate
Nabi-HB
Nabumetone
Nadolol


so how it will be .. pls gives ur suggestions..

What I have tried:

I did not understand how can i do this so please

give me yours answer as soon as possible ..

thanks in advance
Posted
Updated 18-Oct-16 9:10am
v2
Comments
Suvendu Shekhar Giri 18-Oct-16 14:18pm    
You want to do this with C or SQL ?
You are building windows application?

1 solution

If that's your SQL data, then it's a poor data design, and your should consider changing it.
This is the least of the problems you will have with this design, and it's still complex to work round!
See here: Converting comma separated data in a column to rows for selection[^] and you'll get an idea why it's complicated.
A "single value per row" solution is much easier to work with.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900