Stupid T-SQL Tricks – Part 2: Retrieving Columns Set to the Current DEFAULT...
“Heeeeeere’s Johnny!” – Ed McMahon introducing Johnny Carson for the Tonight Show If you’re old enough to remember the Tonight Show hosted by Johnny Carson, how can you not remember the iconic Stupid...
View ArticleAn Easter SQL
Since Easter is nearly upon us, I got to thinking once again about how challenging it is to calculate the day that Easter Sunday falls on. Since Calendar tables and their step-children Holiday tables...
View ArticleAn Even Faster Method of Calculating the Median on a Partitioned Heap
Back in 2013 I wrote an article kindly accepted for publication on the Simple Talk web site called Calculating the Median Value within a Partitioned Set Using T-SQL. In that article, I was delighted...
View ArticleStupid T-SQL Tricks – Part 3: A Zodiacal SQL
Today we’ll learn how you can use T-SQL to calculate your zodiac sign from your birthdate. “Heeeeeere’s Johnny!” – Ed McMahon introducing Johnny Carson for the Tonight Show If you’re old enough to...
View ArticleRuminations on Writing Great T-SQL
Today we’re going to try to extend some advice that I once heard from SQL MVP Jeff Moden, which I wrote about in my previous blog entitled “Make it Work, Make it Fast, Make it Pretty.” That advice was...
View ArticleExcel in T-SQL Part 1 – HARMEAN, GEOMEAN and FREQUENCY
Today’s blog will be the first in a multi-part series on replicating Excel functions in T-SQL, starting with HARMEAN, GEOMEAN and FREQUENCY. We’ll focus our solutions on creating T-SQL in-line, Table...
View ArticleExcel in T-SQL Part 2 – The Normal Distribution (NORM.DIST) Density Functions
Today’s blog will be the second in a multi-part series on replicating Excel functions in T-SQL, continuing with Excel’s NORM.DIST built-in function, thus enshrining my geekdom in the SQLverse forever....
View ArticleThe Best Tool for Comparing Whether Two T-SQL Queries Produce Identical Results
There is one software tool that should be in every software developer’s tool chest. That is knowledge of the platform on which you are developing. With all the hype that surrounds every new software...
View ArticleHigh Performance T-SQL using Code Patterns
What exactly does this mean? We’ve heard of “code patterns” in other programming languages, but what does it mean to use T-SQL code patterns to develop high performance T-SQL? Having now been called...
View ArticleThe Fastest Way to Combine DATE and TIME Data Types to a DATETIME
Recently while working with a table where there were two columns, one a DATE datatype and a second TIME datatype, I found that those needed to be combined into a single DATETIME result column. I won’t...
View Article