Join me on 13 August 2021 for Dativerse
This coming Friday the 13th (August 2021) is the first ever Dativerse virtual conference, hosted by our DataGrillen friends William and Benjamin. According to their site: We try to...
2021-08-11
15 reads
This coming Friday the 13th (August 2021) is the first ever Dativerse virtual conference, hosted by our DataGrillen friends William and Benjamin. According to their site: We try to...
2021-08-11
15 reads
Although I don’t write about it much on this website, I am on the autism spectrum, and I have ADHD. I need to sit at the front of a...
2021-08-04
17 reads
This post is part of the series I kicked off here. You can read my post about captions here. Let’s talk about slides! Many of us are familiar with...
2021-07-28
18 reads
Next week on Wednesday 28 July 2021, I will be presenting a brand-new session titled “How SQL Server stores that data type” for the free EightKB virtual conference. I’ve...
2021-07-21
20 reads
My user group, the Calgary Data User Group, has been recording videos since April of this year, so at the time of this writing we have just two videos...
2021-07-14
13 reads
Today I want to write about the community that brought us all together. The community that got this very website on your radar. The community that got many of...
2021-07-07
12 reads
In early 2011 Jes Borland invited us to write about aggregations: I want to hear how you solved business problems with aggregate functions. I want to see your cool...
2021-06-30
42 reads
It has been some time since I last wrote about Azure SQL Database. Although it has been more than three years since SQL Server 2017 was released, Microsoft have...
2021-06-23
58 reads
If you’d like to check out the previous instalment in this series on storing dates and times, click here. I avoided mentioning this data type because I didn’t think...
2021-06-16
33 reads
Whenever I restore a database — especially one I obtained outside of my regular environment (for example a customer database, a development database, or even a sample database like...
2021-06-09
47 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