I’m going to my first SQL Saturday!
I got to go to the Pass Summit in 2011 and had a fantastic time despite some travel issues caused...
2013-07-24
663 reads
I got to go to the Pass Summit in 2011 and had a fantastic time despite some travel issues caused...
2013-07-24
663 reads
I was researching a problem with a partitioned table that had somehow become unpartitioned and discovered something rather interesting.
First here...
2013-07-22 (first published: 2013-07-15)
2,554 reads
I make a point of reading DBAReactions on a fairly regular basis and today while reading it I was lead...
2013-07-17
832 reads
Generally if I need to do any form of complicated control flow I’ll end up using SSIS, however there is...
2013-07-15 (first published: 2013-07-08)
2,195 reads
A little while back I wrote Best practice recommendations for writing Dynamic SQL where I made a number of suggestions...
2013-07-01
2,725 reads
How will you back out if your change doesn’t work?! Always take a backup! There should always be a back...
2013-06-26
2,425 reads
What is a metadata function? According to BOL a metadata function is one that returns data about the database or...
2013-06-24
830 reads
I’m going to get slammed for the title by someone but I stand by it. First some definitions.
Disaster Recovery...
2013-06-20
940 reads
Have you ever needed to order by a calculated column? You might have written it something like this:
SELECT LoginID, YEAR(HireDate)...
2013-06-19 (first published: 2013-06-17)
2,779 reads
Note this is not “Best Practices when USING Dynamic SQL”. These are just good habits I’ve come up with over...
2013-06-13 (first published: 2013-06-12)
5,585 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