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 |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2005-07-28 : 10:10:24
|
| HiI have data in a column which I have to parse it into different columns according to delimiters, but I realised substring function in SQL Server does not allow delimiters in its argumentscolumn Parse1 Parse2______________________________________AB 234/145 234 145AB123/245 123 245Since in the above eg I am not always sure if delimiter '/' always exists position 6 or 5, I am able to use the substring function to parse the column and populate 243 and 145 into 2 different columns.Any suggestions/inputs would be helpfulThanks |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2005-07-28 : 11:11:17
|
| Hi, Also is there any function to count the occurences of particular charecter like '/' in a string.Thanks |
 |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-07-28 : 11:20:00
|
count characterDeclare @myStr varchar(100)Set @myStr = 'sdkj/g3/28/fs8'Select len(@myStr)-len(Replace(@myStr,'/',''))Corey Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now." |
 |
|
|
|
|
|