May 12, 2016 at 3:24 pm
Comments posted to this topic are about the item Translate function for SQL Server
-- Itzik Ben-Gan 2001
June 1, 2016 at 8:09 am
everything fine, but what's that checksum for ?
June 1, 2016 at 8:53 am
h.tobisch (6/1/2016)
everything fine, but what's that checksum for ?
Currently the fastest known method for converting a bigint to an int.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 1, 2016 at 8:57 am
Nice job Alan.
A few years ago DC and I played with numerous variations of this method as a spinoff of the PatternSplit project. One of the most promising methods was a QU using an inline tally table, where the inline variable is the product, rather than values in the table. I remember it was very fast and made for nice slim maintainable code too.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 1, 2016 at 4:52 pm
ChrisM@Work (6/1/2016)
Nice job Alan.A few years ago DC and I played with numerous variations of this method as a spinoff of the PatternSplit project. One of the most promising methods was a QU using an inline tally table, where the inline variable is the product, rather than values in the table. I remember it was very fast and made for nice slim maintainable code too.
Thanks Chris.
I tried a similar method with the QU and inline tally table which did not perform well, it did very badly actually. I'll send it to you, I'd be interested to see where I went wrong.
It's so cool that you guys played around with this, it's such a fun exercise and great way to sharpen your SQL skills.
-- Itzik Ben-Gan 2001
June 1, 2016 at 4:58 pm
ChrisM@Work (6/1/2016)
h.tobisch (6/1/2016)
everything fine, but what's that checksum for ?Currently the fastest known method for converting a bigint to an int.
I learned this technique from Eirikur Eiriksson. One of those super slick T-SQL tricks that makes SQLServerCentral awesome.
-- Itzik Ben-Gan 2001
June 2, 2016 at 2:02 am
Alan.B (6/1/2016)
ChrisM@Work (6/1/2016)
h.tobisch (6/1/2016)
everything fine, but what's that checksum for ?Currently the fastest known method for converting a bigint to an int.
I learned this technique from Eirikur Eiriksson. One of those super slick T-SQL tricks that makes SQLServerCentral awesome.
EE has super slick beer tricks too - watch out!
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 1, 2016 at 1:23 pm
This looks pretty cool, thanks.
April 18, 2017 at 8:40 am
There is a fine line between "trick" and "hack". This cool function is using lots of side effects which makes me wonder if it might become SQL Server version dependent at some point.
I didn't know substring('abc', 4, 1) would return empty string instead of an error. Maybe I'm too much of an academic purist but all this cleverness makes me feel uneasy.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply