Putting counters in names
It’s not all that unusual, or unreasonable to put a counter in a name. For example let’s say you need ... Continue reading
2022-10-03 (first published: 2022-09-13)
558 reads
It’s not all that unusual, or unreasonable to put a counter in a name. For example let’s say you need ... Continue reading
2022-10-03 (first published: 2022-09-13)
558 reads
Last month (I ran just a little bit late writing this, it was meant to go out 9/29) Brent Ozar ... Continue reading
2022-10-01
111 reads
It’s now been about two and a half months since I was given notice and decided to blog about my ... Continue reading
2022-09-28 (first published: 2022-09-08)
210 reads
One of my co-workers came to me the other day and told me that they found their network id as ... Continue reading
2022-09-21 (first published: 2022-09-06)
340 reads
Recently I talked about the difference between implicit and explicit datatype conversions. In it I ran this code: With the ... Continue reading
2022-09-20
20 reads
I know this is way off my usual content but the other day someone was mentioning how easy it is ... Continue reading
2022-09-15
24 reads
I had every intention of doing Replication Part 2 this month but had a thought I liked better. I will ... Continue reading
2022-09-14 (first published: 2022-09-01)
324 reads
I was asked a rather interesting question during an interview recently. It went something like this: Your resume says you’ve ... Continue reading
2022-09-05 (first published: 2022-08-23)
232 reads
I’ve added a new parameter to my permissions scripts (well, just the main two for now). Fair warning, it’s in ... Continue reading
2022-08-31 (first published: 2022-08-18)
439 reads
Any time I’ve learned about the optimizer there is always one important thing that’s brought up. The optimizer is not ... Continue reading
2022-08-30
24 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