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.
Author |
Topic |
Dan1978
Starting Member
5 Posts |
Posted - 2012-09-10 : 08:37:10
|
Hi, I'm trying to split a single column into a number of columns, with the split being the delimiter of '-'I have enclosed an example below of what I am trying to achieve.If anyone could help, that would be greatThanks in advance for your help.Column 1 Dialler 02 MH LIAB 30-08-12 SEPT REF MB-Renewal Date Obtained/CorrectedAfter Split ( 4 columns)New Column 1 New Column 2 New Column 3 New Column 4Dialler 02 MH LIAB 30 08 12 SEPT REF MB Renewal Date Obtained/Corrected |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-09-10 : 08:55:34
|
Use a string-splitter function such as the one described here: http://www.sqlservercentral.com/articles/Tally+Table/72993/ Copy and install the function from Fig. 21 in that article. Then you would use it as [dbo].[DelimitedSplit8K](YourStringColumn,'-') |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|