April 29, 2009 at 7:55 pm
Paul White (4/29/2009)
Jeff Moden (4/29/2009)
http://www.sqlservercentral.com/articles/T-SQL/63003/Thanks Jeff,
I have read that before, and use that approach currently.
When Adam asked for ideas to extend the string-split, this came to mind.
It would be interesting to compare the two approaches...
It's a great article by the way.
Paul
Thanks, Paul. I appreciate the feedback... didn't know you already knew about it.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 29, 2009 at 8:04 pm
Jeff Moden (4/29/2009)
Thanks, Paul. I appreciate the feedback... didn't know you already knew about it.
😎 I didn't know that you didn't know I knew about it...over to you 😉
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
April 29, 2009 at 8:26 pm
Paul White (4/29/2009)
Jeff Moden (4/29/2009)
Thanks, Paul. I appreciate the feedback... didn't know you already knew about it.😎 I didn't know that you didn't know I knew about it...over to you 😉
Well, I knew the you didn't know that I didn't know that your knew about it. 😛
Hmmmm.... "There's a hole in the bottom of the sea..."
--Jeff Moden
Change is inevitable... Change for the better is not.
April 29, 2009 at 9:04 pm
Jeff Moden (4/29/2009)
Well, I knew that you didn't know that I didn't know that your knew about it. 😛
I knew you were going to say that...
Jeff Moden (4/29/2009)
Hmmmm.... "There's a hole in the bottom of the sea..."
There's a hole in the bottom of the sea
There's a hole, there's a hole
There's a hole in the bottom of the sea.
There's a log in the hole in the bottom of the sea
There's a log in the hole in the bottom of the sea
There's a log, there's a log
There's a log in the hole in the bottom of the sea.
There's a branch on the log in the hole in the bottom of the sea
There's a branch on the log in the hole in the bottom of the sea
There's a branch, there's a branch
There's a branch on the log in the hole in the bottom of the sea.
There's a bump on the branch on the log in the hole in the bottom of the sea
There's a bump on the branch on the log in the hole in the bottom of the sea
There's a bump, there's a bump
There's a bump on the branch on the log in the hole in the bottom of the sea.
There's a frog on the bump on the branch on the log in the hole in the bottom of the sea
There's a frog on the bump on the branch on the log in the hole in the bottom of the sea
There's a frog, there's a frog
There's a frog on the bump on the branch on the log in the hole in the bottom of the sea.
There's a tail on the frog on the bump on the branch on the log in the hole in the bottom of the sea
There's a tail on the frog on the bump on the branch on the log in the hole in the bottom of the sea
There's a tail, there's a tail
There's a tail on the frog on the bump on the branch on the log in the hole in the bottom of the sea.
There's a speck on the tail on the frog on the bump on the branch on the log in the hole in the
bottom of the sea
There's a speck on the tail on the frog on the bump on the branch on the log in the hole in the
bottom of the sea
There's a speck, there's a speck
There's a speck on the tail on the frog on the bump on the branch on the log in the hole in the
bottom of the sea.
There's a fleck on the speck on the tail on the frog on the bump on the branch on the log in
the hole in the bottom of the sea
There's a fleck on the speck on the tail on the frog on the bump on the branch on the log in
the hole in the bottom of the sea
There's a fleck, there's a fleck
There's a fleck on the speck on the tail on the frog on the bump on the branch on the log in
the hole in the bottom of the sea.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
April 29, 2009 at 10:20 pm
Heh... oh my... someone is as crazy as I. Ya gotta be to know songs like that. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2009 at 1:53 am
There's a hole in the bottom of the sea
There's a hole in the bottom of the sea
......
Which method did you use to split that prose 😉
Heh... oh my... someone is as crazy as I.
Well I geuessed you were 😀 but to have you confirm it... well :Wow:
Far away is close at hand in the images of elsewhere.
Anon.
April 30, 2009 at 2:19 am
Jeff Moden (4/29/2009)
http://www.sqlservercentral.com/articles/T-SQL/63003/
Thanks Jeff!
Great article! Am I allowed to refer to?
Greets
Flo
April 30, 2009 at 10:22 am
Florian Reischl (4/30/2009)
Jeff Moden (4/29/2009)
http://www.sqlservercentral.com/articles/T-SQL/63003/Thanks Jeff!
Great article! Am I allowed to refer to?
Greets
Flo
Absolutely.
I also have some code for you on cleaning a string. I've repaired the performance problem you and I were having in conjunction with using the STUFF function. Do you have the URL of that old post you and I went through 5 or 6 weeks back? The search engine on this forum doesn't even believe that you've used the word "Tally" in any of your posts ever.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 30, 2009 at 12:04 pm
Jeff Moden (4/30/2009)
Florian Reischl (4/30/2009)
Jeff Moden (4/29/2009)
http://www.sqlservercentral.com/articles/T-SQL/63003/Thanks Jeff!
Great article! Am I allowed to refer to?
Absolutely.
Thank you!
I also have some code for you on cleaning a string. I've repaired the performance problem you and I were having in conjunction with using the STUFF function. Do you have the URL of that old post you and I went through 5 or 6 weeks back?
We had a performance issue in conjunction with STUFF? Maybe, I'm just gone blank... :doze:
The search engine on this forum doesn't even believe that you've used the word "Tally" in any of your posts ever.
Strange. If I search for "reischl tally" I get 31 hits.
Better: Use google and search "reischl tally site:sqlservercentral.com", then you get 74 hits (which still seems to be not enough).
Greets
Flo
May 1, 2009 at 2:42 am
Strange. If I search for "reischl tally" I get 31 hits.
Better: Use google and search "reischl tally site:sqlservercentral.com", then you get 74 hits (which still seems to be not enough).
I think this is because the search engines are using post content, so unless someone quotes your name, you edit a post or submit an article, your name will not be searchable.
Far away is close at hand in the images of elsewhere.
Anon.
May 1, 2009 at 3:28 am
David Burrows (4/30/2009)
Which method did you use to split that prose 😉
I used a tally table of course!
😀
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
May 1, 2009 at 6:27 am
Florian Reischl (4/30/2009)
We had a performance issue in conjunction with STUFF? Maybe, I'm just gone blank... :doze:
Maybe it's just me and I'm thinking of the wrong person. It was a post about using the Tally table to clean a string using the ol' split and concatenate method which, of course, is going to be quite a bit slower than a loop that uses STUFF because concatenation is so slow. I figured out a really simple way to use the Tally with STUFF. The problem was that I had to figure out a way make it work in the face of a string that was constantly changing length from left to right where the actual position of the bad characters was also constantly changing during the cleaning process.
I wanted to refer to that particular thread and I can't it.
Anyway, here's the code...
[font="Courier New"]--===== Company name is in a variable
DECLARE @CompanyName VARCHAR(256)
SELECT @CompanyName = 'A & B Cleaners'
PRINT @CompanyName --Just for verification... you can remove this line
--===== Using a "Tally" table as a loop driver, remove all characters that
-- are NOT in the in range of A to Z (upper or lower case)
SELECT @CompanyName = STUFF(@CompanyName,PATINDEX('%[^A-Z]%',@CompanyName),1,'')
FROM dbo.Tally t
WHERE t.N <= LEN(@CompanyName)
AND SUBSTRING(@CompanyName,t.N,1) LIKE '[^A-Z]'
--===== Grab just the left six characters of what remains.
SELECT @CompanyName = LEFT(@CompanyName,6)
--===== Display the result (just for verification... you can remove this line)
PRINT @CompanyName[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
May 1, 2009 at 6:31 am
Almost forgot... the reason why I don't use the code windows anymore is because, although they may work fine with FireFox, they suck when using IE7. The remove blank lines on insert and add blank lines while removing leading space when copying. I've sent all the details to Steve and Tony, but their developers seem unable to fix things so they work like they used to... I'll gladly trade the pretty colors and the occasional smiley face for code that keeps the same format I wrote it in.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 1, 2009 at 6:51 am
Jeff,
...but their developers seem unable to fix things so they work like they used to.
Ouch.
They're doing all they can to put in a better solution ASAP. The problem was that it became impossible to improve the browser-side 'prettifier' without a lot of effort (Javascript regex solutions can only do so much) and they are planning on using a vastly better server-side solution. They're working on it urgently at this very moment.
You can always use my Prettifier in the meantime!
Best wishes,
Phil Factor
May 1, 2009 at 6:57 am
Jeff Moden (5/1/2009)
Almost forgot... the reason why I don't use the code windows anymore is because, although they may work fine with FireFox, they suck when using IE7. The remove blank lines on insert and add blank lines while removing leading space when copying. I've sent all the details to Steve and Tony, but their developers seem unable to fix things so they work like they used to... I'll gladly trade the pretty colors and the occasional smiley face for code that keeps the same format I wrote it in.
Hi Jeff
Did you try the good old pettifier here? Maybe it works better with IE.
I'm currently analyzing your STUFF function ;-).
Greets
Flo
Viewing 15 posts - 331 through 345 (of 522 total)
You must be logged in to reply to this topic. Login to reply