SQL Window Functions Series: LAG() and LEAD()
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
8,376 reads
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
8,376 reads
The most common method on the internet for combining DATE and TIME columns in SQL Server is incorrect. This article demonstrates why that and other methods are incorrect and two lesser known high performance methods that produce correct results even for the "edge cases".
2023-08-07
22,595 reads
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
32,790 reads
A function to add or subtract working days taking into account weekends and using a table of non-working days.
2019-07-10 (first published: 2019-06-26)
5,191 reads
2018-02-23 (first published: 2018-02-19)
153 reads
2017-12-29
1,088 reads
This script provides the day of the month for the standard bank holidays for any given year. This is especially useful for computing the workday after a holiday.
2017-05-24 (first published: 2017-05-10)
499 reads
By gbargsley
Recently, I was in a technical interview where the topic of running PowerShell at...
By alevyinroc
I don’t recall where this came up (probably in SQLSlack), but I had a...
By Steve Jones
One of the parts of getting older that really sucks is I seem to...
Hi, we put together an extract that runs every 15 minutes against what i...
Comments posted to this topic are about the item Parameter Sensitive Plan Optimization in...
Comments posted to this topic are about the item Minimum Change Tracking Retention
If I am running this code:
ALTER DATABASE AdventureWorks2017 SET CHANGE_TRACKING = ON (CHANGE_RETENTION=xxx);What is the minimum amount of time I can set? See possible answers