A New Word: Emodox
emodox – someone whose mood is perpetually out of sync with everyone else around them, prone to feelings of naptime panic, heart-to-heart snark, or dance club pensiveness. I had...
2023-11-24
49 reads
emodox – someone whose mood is perpetually out of sync with everyone else around them, prone to feelings of naptime panic, heart-to-heart snark, or dance club pensiveness. I had...
2023-11-24
49 reads
2023-11-24
158 reads
I had written about a FK in a CREATE TABLE statement recently, but the second half of this was that after the original question, the person asked if this...
2023-11-24 (first published: 2023-11-06)
257 reads
I’ve been to a lot of conferences, and one that I’ve probably attended the most is the annual PASS Data Community Summit. It’s been listed under various names, but...
2023-11-24
82 reads
2023-11-24
430 reads
2023-11-22
443 reads
Today Steve talks about data modeling and how standards can transfer knowledge between developers.
2023-11-22
465 reads
Last week was the 168th T-SQL Tuesday, which I hosted. The invitation is here. I didn’t get much of a chance to check out the posts as I was...
2023-11-21
26 reads
2023-11-20
345 reads
Recently a customer was looking to automate some of their SQL Compare checks, but they wanted to do this in a dynamic way, since they needed to do this...
2023-11-20 (first published: 2023-11-08)
400 reads
By HeyMo0sh
Working in DevOps long enough teaches you two universal truths: That’s exactly why I...
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...
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