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 |
|
Vaishu
Posting Yak Master
178 Posts |
Posted - 2008-07-29 : 08:02:39
|
| Hi I have coloum in table containing string like belowex:SDFRT56789-1/9GHJKYUURE/212SDF-PR-1/1QWER45TY/3..........How do I read number after the "/" in the above stringAdvance thanks |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-29 : 08:07:33
|
| SELECT RIGHT(yourString,1), if it's always last in the stringJim |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-29 : 08:37:04
|
or use charindex() to find the position of '/' and use substring() to extract it. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-29 : 09:39:55
|
| This would help you,SELECT substring('QWER45TY/3',charindex('/','QWER45TY/3')+1,len('QWER45TY/3'))orselect right('QWER45TY/3',(len('QWER45TY/3')-charindex('/','QWER45TY/3')))If there any issues,let me know |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-29 : 09:46:40
|
| select substring(@string,charindex('/',@string)+1,1)jim |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-29 : 09:46:55
|
| or If your data dont have '.', declare @t varchar(100)set @t ='SDFRT56789-1/9'select parsename(replace(@t,'/','.'),1)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|