June 2, 2006 at 9:18 am
memememe::kjsdfkjfds::ksjf::iuhsaf
sdffsd::safsdf
sdffs::sdfsdf:11231231::safdsfds::sdffssdf::sdfs
sdfsdffsdfsdf::sdfsdf::sfsdf::sdfsdf::sadfdssfds
dsffsfdfsdfsfdsfddf::sdfsfsfdfdssd::sdfsddfsdf
field in table contains the example data above I need a select query where it selects everything right of the last occurrance of :: very easy to do with left and first instance of :: but struggling how to do it for last instance and right .... any help
June 2, 2006 at 9:41 am
Use the left and first instance method, on the REVERSE of the string.
June 2, 2006 at 9:45 am
June 2, 2006 at 9:58 am
Not in TSQL you can't.
[edit: oh i see it's a UDF. There are better ways of splitting strings though. But this request was not about doing that anyway.]
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 2, 2006 at 9:58 am
You can use
select * from Split('memememe::kjsdfkjfds::ksjf::iuhsaf
sdffsd::safsdf
sdffs::sdfsdf:11231231::safdsfds::sdffssdf::sdfs
sdfsdffsdfsdf::sdfsdf::sfsdf::sdfsdf::sadfdssfds
dsffsfdfsdfsfdsfddf::sdfsfsfdfdssd::sdfsddfsdf','::')
http://www.sqlservercentral.com/memberservices/updatescript.asp?Approve=y&scriptid=850
June 4, 2006 at 4:44 am
June 7, 2006 at 7:31 am
sorry I did not say thanks earlier but been away, so thanks,
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply