August 20, 2012 at 7:40 am
I have to ask why you have "Señorita" but not "Señor", and a few others like that. Or did I just miss them in the list?
As far as the code goes, you might be better off moving this kind of thing into a CLR object. Performance will probably be better there, as T-SQL is poor at both string functions and loops, while CLR is good at both of those.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 20, 2012 at 7:45 am
Thanks for the feedback GSquared.
I started off with a small list for my titles but then I added some more from a list of titles I found online 😀
---------------------------------------------------------
It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens[/url]
Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
August 20, 2012 at 8:27 am
As a proof-of-concept exercise, I built a "set-based" version of your UDF. It doesn't use any explicit loops, and so on. I tested the two side-by-side, and the one you have is about 4X faster than the set-based version. Because of the complexity of the rules here, it's massively over-complex, including multiple CTEs, some Outer Apply functions, and so on. Just a mess.
So CLR is almost certainly your best bet, as expected.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 20, 2012 at 8:32 am
Thanks CSGuard. I will try and create a CLR implementation if time permits and will report back.
---------------------------------------------------------
It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens[/url]
Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply