2021-03-18
676 reads
2021-03-18
676 reads
After the first article created a Calendar table, learn how to use this in a practical sense with some common queries.
2020-05-15 (first published: 2016-10-13)
8,197 reads
This second part to a previous article on Calendar table generation shows how to create a holiday table containing both fixed-date and variable-date holidays.
2018-12-25 (first published: 2016-09-19)
8,101 reads
Although it is common to group by periods such as Week, Month, or Quarter, sometimes alternative periods are needed. This simple technique lets you split a year into periods with any number of days.
2017-12-08 (first published: 2016-09-26)
4,177 reads
This article introduces the concept of the Calendar table to SQL newcomers and illustrates use of a few columns they might not have imagined.
2017-11-24 (first published: 2016-09-08)
18,202 reads
2016-09-05
1,355 reads
2016-08-18
1,511 reads
Why does everyone use "it depends" as an answer to many T-SQL questions? Bob Hovious brings us a short example of how performance can change based on data loads for the same code.
2010-03-16
13,220 reads
By Steve Jones
ecstatic shock – n. a surge of energy upon catching a glimpse from someone...
By Chris Yates
The New Arena of Leadership The role of the Chief Data Officer is no...
Presenting you with an updated version of our sp_snapshot procedure, allowing you to easily...
Comments posted to this topic are about the item Lessons from the Postmark-MCP Backdoor
Just saw the "Azure Extension for SQL Server" Does anyone has experience with it?...
I've noticed several instances of what looks like a recursive insert with the format:...
I have a table with this data:
TravelLogID CityID StartDate EndDate 1 1 2025-01-01 2025-01-06 2 2 2025-01-01 2025-01-06 3 3 2025-01-01 2025-01-06 4 4 2025-01-01 2025-01-06 5 5 2025-01-01 2025-01-06I run this code:
SELECT IDENT_CURRENT('TravelLog')I get the value 5 back. Now I do this:
SET IDENTITY_INSERT dbo.TravelLog ON INSERT dbo.TravelLog ( TravelLogID, CityID, StartDate, EndDate ) VALUES (25, 5, '2025-09-12', '2025-09-17') SET IDENTITY_INSERT dbo.TravelLog OFFI now run this code.
DBCC CHECKIDENT(TravelLog) GO INSERT dbo.TravelLog ( CityID, StartDate, EndDate ) VALUES (4, '2025-10-14', '2025-10-17') GOWhat is the value for TravelLogID for the row I inserted for CityID 4 and dates starting on 14 Oct 2025? See possible answers