Database Fundamentals #10: Modifying Tables
Invariably, either while building a new database, or while maintaining old ones, you will find that the business needs change...
2017-09-12
402 reads
Invariably, either while building a new database, or while maintaining old ones, you will find that the business needs change...
2017-09-12
402 reads
Capturing query execution metrics is much easier now that you can see the runtime metrics in execution plans when you’re...
2017-09-06 (first published: 2017-08-22)
1,604 reads
I recently read an article asking the question whether or not we downplay the role that luck plays in our...
2017-09-05
323 reads
Over at Redgate, we’ve been working on a new way to get information to you. It’s called the Redgate Hub....
2017-09-04 (first published: 2017-08-23)
860 reads
Guten Tag!
OK, switching back to English for the rest of this.
I’m going to be spending a few weeks in Germany...
2017-08-30
533 reads
SQL Server provides all different kinds of data types in order to give you more flexibility and control for how...
2017-08-29
646 reads
SQL Server provides all different kinds of data types in order to give you more flexibility and control for how...
2017-08-29
1,425 reads
Are you going to be in Florida in November? Me too. I’m privileged to say that I get to speak...
2017-08-28
287 reads
Are you going to be in Florida in November? Me too. I’m privileged to say that I get to speak...
2017-08-28
439 reads
Lots of people are confused by how to deal with bad parameter sniffing when it occurs. In an effort to...
2017-08-24 (first published: 2017-08-15)
2,358 reads
By HeyMo0sh
Over time, I’ve realised that one of the hardest parts of cloud management isn’t...
By HeyMo0sh
One of the biggest challenges I’ve faced in cloud operations is maintaining clear visibility...
By Steve Jones
I come to Heathrow often. Today is likely somewhere close to 60 trips to...
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