2024-12-16
1,765 reads
2024-12-16
1,765 reads
dolonia – n. a state of unease prompted by people who seem to like you too much, which makes you wonder if they must have you confused with someone...
2024-12-13
64 reads
I had mentioned some new T-SQL functions for SQL Server 2022 and a commenter asked about the difference between Min() and First_value. This post looks at a few cases....
2024-12-13 (first published: 2024-12-04)
706 reads
Earlier this year I had a PM at Microsoft reach out and ask me what I thought about the Data API Builder. I hadn't looked at it, so I made a note to check it out. I hadn't done that by the time SQL Saturday Denver 2024 occurred, where I saw Jerry Nixon from Microsoft […]
2024-12-13
7,035 reads
2024-12-13
112 reads
2024-12-13
1,637 reads
Can an AI help me with some database API work? Let’s see. This is part of a series of experiments with AI systems. The Scenario One of the things...
2024-12-11
128 reads
2024-12-11
169 reads
2024-12-11
1,194 reads
It’s the last T-SQL Tuesday of the year, and it’s amazing to think we’ve gotten to #181. That’s over 15 years of monthly blog parties. This month we have...
2024-12-10
39 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