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 |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-04-07 : 10:34:18
|
| Hello,I have a field like below which has blanks 'b';CODE000123'b'99999'b'RED RINGWHAT i want to do is like below?FIELD1000123FIELD299999FIELD3RED RING |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-07 : 10:38:46
|
| [code]SelectParsename(Replace(col, '''b''', '.'), 3) as Field1,Parsename(Replace(col, '''b''', '.'), 2) as Field2,Parsename(Replace(col, '''b''', '.'), 1) as Field3from table[/code]Of course, this work only if your data doesn't contain '.' character and there are no more than four fields you want to separate out.Otherwise, search for fn_split() here.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|