T-SQL Tuesday #51: Is this a bet worth making?
On the second Tuesday of each month, the SQL Server universe all comes together to blog about a topic. Known...
2014-02-14 (first published: 2014-02-11)
1,801 reads
On the second Tuesday of each month, the SQL Server universe all comes together to blog about a topic. Known...
2014-02-14 (first published: 2014-02-11)
1,801 reads
I’ve been using SQL Prompt for years. In September 2013, version 6 was released (quickly followed by 6.1 in late...
2014-01-31 (first published: 2014-01-27)
3,067 reads
I was recently investigating an issue that stemmed from a database being in the recovery_pending state. A quick investigation through...
2014-01-20
822 reads
I was recently just letting my mind wander. As it’s prone to do, all sorts of things just entered into...
2014-01-14
777 reads
Previously, I posted a list of interview questions that I ask job candidates. This post is about the questions that...
2014-01-10 (first published: 2014-01-06)
4,138 reads
Now, why in the world would I be asking a question like this?
Well, in BOL (BACKUP) is this little blurb:
CHECKSUM
Specifies...
2014-01-06 (first published: 2013-12-30)
2,873 reads
So here it is, the second Tuesday of the month. This means that it is time for our favorite Tuesday...
2013-11-13
621 reads
I was looking into a failed job on a SQL Server 2008R2 instance. My first step was to check the...
2013-11-15 (first published: 2013-11-07)
1,665 reads
For those of you that know me, you know that I enjoy learning, and passing on what I have learned...
2013-11-06
782 reads
Image acquired from Twitter
In my recent blog post on “Retiring of the MCM Certifications”, there is a link to a...
2013-09-03
1,338 reads
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...
SELECT * feels convenient, but in SQL Server it bloats I/O, burns network bandwidth,...
I've noticed several instances of what looks like a recursive insert with the format:...
Comments posted to this topic are about the item Cleaning Up the Cloud
Comments posted to this topic are about the item The Maximum Value in the...
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