Merge statement- A simple way for DML TIP#105
When, I first saw this statement a Hindi proverb come to my mind which is “1 teer 2 nishane” . The...
2015-07-18
952 reads
When, I first saw this statement a Hindi proverb come to my mind which is “1 teer 2 nishane” . The...
2015-07-18
952 reads
We always take NULL very lightly. Like if we are designing database then whether it is necessary or not we...
2015-07-15 (first published: 2015-07-06)
2,711 reads
Recently, When we were delivering session on “SQL SERVER” one of the persons asked why we require Aliasing so I...
2015-07-09
460 reads
Dear All,
“Microsoft Most Valuable Professional “ – MVP is one of the prestigious tag. It is one of the dreams which came...
2015-07-02
477 reads
It’s almost one month that I didn’t write anything on the blog due to some personal reason. I am really...
2015-06-22 (first published: 2015-06-12)
2,429 reads
I don’t know why every interviewer’s favorite question “Can we insert record using View ?” If you say Yes/No the interviewer...
2015-06-20
525 reads
Let’s consider a scenario where the end user require a CSV file of all the records in a table then...
2015-06-18
1,294 reads
On last Friday , one of my colleagues had some issue related to accessing of SQL Server instance of database server...
2015-05-11 (first published: 2015-05-04)
5,914 reads
In TIP #70 we saw how to find all the running SQL SERVER instance in a network or a machine....
2015-05-04
668 reads
In last post, TIP#96 We have configured Database E-mail. Now in this post we will see how to send mail...
2015-04-26
8,592 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