SQL Server: Listing all the database roles for a given database user
SQL Server 2005 introduces Common Table Expressions (CTEs), which are great for recursive queries. Previously, in order to do recursion,...
2007-10-30
2,569 reads
SQL Server 2005 introduces Common Table Expressions (CTEs), which are great for recursive queries. Previously, in order to do recursion,...
2007-10-30
2,569 reads
A recent thread on SQLServerCentral.com had an individual what it took to be a successful DBA. Couple that with a...
2007-10-29
1,674 reads
For a variety reasons, including personal/family concerns and workload, I've not been able to write as often as I'd like....
2007-10-28
1,466 reads
Noted SQL Server security expert, Chip Andrews, has released an alpha version of a command-line version of SQLPing3. You can...
2007-10-25
2,308 reads
How to Cheat at Securing SQL Server 2005
I recently had the opportunity to contribute a couple of chapters to this...
2007-10-04
547 reads
Taya Blanchard to speak on A
Practical Guide to Making Sense of Your SQL Server Application
Performance
Midlands PASS Chapter - October...
2007-10-03
576 reads
I have been on vacation the last week, which meant I spent the previous three weeks at work preparing to...
2007-09-10
607 reads
"Database Professional Toolkit" with Brian and Jeremy
Midlands PASS Chapter - August 2, 2007 Meeting
Sponsored by Red Gate Software
The Midlands PASS Chapter...
2007-07-31
1,562 reads
If you're a Microsoft MVP, ApexSQL has brought back their industry experts program. You can find out more about it...
2007-07-25
1,729 reads
First saw information about a tool called SQL Internals Viewer in a blog post here at Kalen Delaney's blog. The...
2007-07-20
1,656 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