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 |
|
eugz
Posting Yak Master
210 Posts |
Posted - 2012-02-27 : 12:38:46
|
| Hi All.I have string:2638 ABA, DDA COMM YES 001213 01 1295760 AA6272 YES D2650 BBADI, JJJJHEED COMM NO 001360 01 1477530 NO DHow to split it to the columns? And if is it possible I would like split to columns ABA, DDA and BBADI, JJJJHEED?Thanks. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
eugz
Posting Yak Master
210 Posts |
Posted - 2012-02-27 : 16:03:58
|
| Thanks for replay.I found that sample:'Doe, John'SELECT SUBSTRING('Doe, John',0,CHARINDEX(',','Doe, John')) AS LastName,SUBSTRING('Doe, John',CHARINDEX(',','Doe, John')+1,len('Doe, John')) AS FirstnameBut how to split to LastName FirstName MI if string is 'Doe, John N'?Thanks. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-27 : 19:26:36
|
| in the latter case what should be first and lastname?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|