2024-06-21
456 reads
2024-06-21
456 reads
I’m heading to SQL Saturday South Florida 2024 next week. This is my second time attending the event and if you’re in the Miami area (or want to take...
2024-06-20
16 reads
2024-06-19
404 reads
I returned last Sat, 15 Jun, from 9 weeks of crazy travel. It wasn’t all for work, but it was a long stretch. I spent a good portion of...
2024-06-19
15 reads
An alert from the US government says that SQL Injection isn't an acceptable problem.
2024-06-19
321 reads
2024-06-17
320 reads
Recently I was trying to delete a folder and kept getting the “something is using this, try again” dialog. It was annoying, but I couldn’t figure out what process...
2024-06-17 (first published: 2024-05-27)
571 reads
2024-06-17
222 reads
2024-06-14
329 reads
Recently I’ve been looking at archiving some data at SQL Saturday, possibly querying it, and perhaps building a data warehouse of sorts. The modern view of data warehousing seems...
2024-06-14 (first published: 2024-05-20)
341 reads
By Steve Jones
Finding duplicates was an interview question for me years ago, and I’ve never forgotten...
By HeyMo0sh
Over time, I’ve realised that one of the hardest parts of cloud management isn’t...
By HeyMo0sh
One of the biggest challenges I’ve faced in cloud operations is maintaining clear visibility...
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
Comments posted to this topic are about the item Answering Questions On Dropped Columns
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