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
10,931 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
10,931 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
25,114 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
34,883 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,225 reads
2018-02-23 (first published: 2018-02-19)
163 reads
2017-12-29
1,093 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)
506 reads
By gbargsley
A New Chapter: Why I Made the Move from Dayforce to ESO Over the...
By Vinay Thakur
When you have a project or system, it has to be optimized, tuned, and...
NO AI was used to generate this content. Grammarly was used to check and...
Hi, We are looking out to read parquet file directly from on premise shared...
We want to enable ADR on our SQL Server 2019 instances. I’ve heard that...
Comments posted to this topic are about the item Forward Deployed Engineers
I have a SQL Server 2025 database that I want to check for corruption every night. One of the things we do is disable indexes used for ETL loads during the weekend and re-enable them on Monday morning. If we run DBCC over the weekend, are our disabled indexes checked for consistency?
See possible answers