Script: Backup All your Databases
We all know the importance of taking regular backups of our SQL Server databases. This is a useful little script...
2010-03-18
1,715 reads
We all know the importance of taking regular backups of our SQL Server databases. This is a useful little script...
2010-03-18
1,715 reads
This is a short post on enabling file streaming. I have read a few sources that cover the same topic...
2010-03-16
740 reads
Recently I wrote a short post on the default trace in SQL Server. You can read that here. In this...
2010-03-14
14,751 reads
This post is the second post in my series about Database mirroring. For part one is titled Configuring Database Mirroring...
2010-03-11
733 reads
“IO IO, It’s off to disk we go!” was in Mike Walsh’s blog post that introduced this TSQL Tuesday and...
2010-03-09
575 reads
I plan on writing a series of posts on database mirroring, this is the first. Database Mirroring is a new...
2010-03-07
3,708 reads
I have taken some time off this week, I have been to the beach with my two golden retriever puppies....
2010-03-04
684 reads
I got my copy of MVP deep dives earlier this month and have been making good progress in reading some...
2010-03-02
862 reads
There are some new database roles in the MSDB database in SQL Server 2005 that allow you to grant more...
2010-02-28
15,112 reads
I needed to upgrade the underlying IO subsystem of one of my IO intensive SQL Servers. After some discussion with...
2010-02-25
2,137 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