T-SQL Tuesday #86: Enhancement Requests
On the second Tuesday of each month, the SQL Server universe all comes together to blog about a topic. Known...
2017-01-10
397 reads
On the second Tuesday of each month, the SQL Server universe all comes together to blog about a topic. Known...
2017-01-10
397 reads
How SQL Server uses Windows Virtual Accounts and local groups
Managed Service Accounts (MSAs) and Virtual Accounts were introduced in Windows...
2016-12-28
2,401 reads
Way back in 2006, Paul Randal documented DBCC PAGE on his Microsoft blog at http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/06/10/625659.aspx. In his post, you will...
2016-12-21
424 reads
It’s that time of the month… the time when all of the T-SQL bloggers have a party and blog about...
2016-12-13
393 reads
Most of the DBCC commands return their results as textual output, even if you have SSMS configured to return result...
2016-11-16
451 reads
You know, these 1 hour sessions that are at most SQL Saturdays are just too short sometimes – you just get...
2015-07-20
753 reads
A while back, I wrote a blog post showing the differences (including performance) between Inline Table-Valued Functions (ITVF) and Multi-Statement...
2015-07-16
1,058 reads
You know, these 1 hour sessions that are at most SQL Saturdays are just too short sometimes – you just get...
2015-05-11
571 reads
Earlier this month, I hosted the 61st occurrence of the monthly TSQL-Tuesday blogging party. With a topic of “Giving Back”,...
2014-12-31
1,374 reads
A little over 5 years ago, Adam Machanic (B|T) had this great idea of getting everyone in the SQL Community...
2014-12-09
705 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