Poor Little Misunderstood Views
Some people love ‘em, some people hate ‘em. But, one thing I have found to be nearly universal is that...
2010-07-29
59,931 reads
Some people love ‘em, some people hate ‘em. But, one thing I have found to be nearly universal is that...
2010-07-29
59,931 reads
Have you ever written a query that just seems to take forever? You have looked it over time and time...
2010-07-13
976 reads
Many people, once they start getting comfortable writing SQL, begin asking the same questions. One such common question is “Does...
2010-07-07
1,303 reads
A pervasive oversight in database indexing by newer database users is relying solely on indexes used for joining tables together...
2010-07-01
3,736 reads
The following queries look extremely innocent. However, they are all application killers once the target table grows to more than...
2010-06-28
1,352 reads
One of the first roadblocks many developers run into when using SQL Server for the first time is firing off...
2010-06-24
2,578 reads
Time and time again I have run into the scenario where a developer who is moving into using databases is...
2010-06-22
710 reads
Here’s a big statement
WHEN WRITING DATABASE QUERIES, 95% OF THE TIME THE BOTTLENECK IS IN THE I/O, not the CPU,...
2010-06-10
967 reads
In my real-life I play guitar. Being an analytical sort-of-fella I found myself inhaling all the books, videos, advice, etc....
2010-06-08
660 reads
Bear with me as I wax philosophical for two sentences. Our societies are becoming more polarized with each passing day. ...
2010-06-03
681 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...
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