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
 sql query - need help!

Author  Topic 

faith2011
Starting Member

9 Posts

Posted - 2014-11-20 : 00:52:07
I need help with splitting one column data into number of columns.
name. Below are the sample of names

Doxycycline 200 mg capsule
Effexor 100 mg tablet
Duragesic 50 mcg/hr Transderm Patch
Ambien CR 6.25 mg Tab

My desired results are below..

name dose meas misc
Doxcycline 200 mg capsule
Effexor 100 mg tablet
Duragesic 50 mcg Transderm Patch
Ambien CR 6.25 mg Tab

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-20 : 09:01:53
This article:

http://www.sqlservercentral.com/articles/Tally+Table/72993/

discusses a Table valued function that can help you do what you want.
Go to Top of Page
   

- Advertisement -