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,803 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,803 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,073 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
827 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
784 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,142 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,881 reads
So here it is, the second Tuesday of the month. This means that it is time for our favorite Tuesday...
2013-11-13
626 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,667 reads
For those of you that know me, you know that I enjoy learning, and passing on what I have learned...
2013-11-06
785 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,344 reads
By Brian Kelley
I will be leading an in-person Certified Information Systems Auditor (CISA) exam prep class...
EightKB is back again for 2026! The biggest online SQL Server internals conference is...
By HeyMo0sh
Working in DevOps long enough teaches you two universal truths: That’s exactly why I...
Hi all, I just started using VS Code to work with DB projects. I...
Comments posted to this topic are about the item Fun with JSON II
Comments posted to this topic are about the item Changing Data Types
I have some data in a table:
CREATE TABLE #test_data
(
id INT PRIMARY KEY,
name VARCHAR(100),
birth_date DATE
);
-- Step 2: Insert rows
INSERT INTO #test_data
VALUES
(1, 'Olivia', '2025-01-05'),
(2, 'Emma', '2025-03-02'),
(3, 'Liam', '2025-11-15'),
(4, 'Noah', '2025-12-22');
If I run this query, how many rows are returned?
SELECT t1.[key] AS row,
t2.*
FROM OPENJSON(
(
SELECT t.* FROM #test_data AS t FOR JSON PATH
)
) t1
CROSS APPLY OPENJSON(t1.value) t2; See possible answers