What I Love About My Job
In June this year I took redundancy from the company I’d worked at for the previous 11 years. It was of course an uncertain time while I figured out...
2023-12-25 (first published: 2023-12-07)
206 reads
In June this year I took redundancy from the company I’d worked at for the previous 11 years. It was of course an uncertain time while I figured out...
2023-12-25 (first published: 2023-12-07)
206 reads
Huge thanks to everyone who responded to my invitation to blog on Encryption and Data Protection for this month’s T-SQL Tuesday. I got what I hoped for, which was...
2023-10-30 (first published: 2023-10-17)
318 reads
I have the honour of hosting this month’s T-SQL Tuesday. In case there’s any doubt that’s for October 2023, I’m posting this invitation a little early as I got...
2023-09-29
29 reads
Having up to date statistics is vital for getting the best performance out of your queries. Even though SQL Server automatically updates statistics in the background for you, you...
2023-09-06
33 reads
I’ve mentioned previously how not having up to date statistics can cause problems in query performance. This post looks at something called the Ascending Key Problem which can badly...
2023-07-21
120 reads
In previous posts we've looked at a number of aspects of Always Encrypted and how it works. I think it's very useful to understand how it actually works in...
2023-07-03 (first published: 2023-06-15)
244 reads
Statistics objects are important for allowing the SQL Server Optimizer to make good estimates and form efficient execution plans. Related to that it's useful for us to understand when...
2023-06-28
153 reads
Parameter Sensitive Plan (PSP) optimization is a new feature in SQL Server 2022 that aims to improve the performance of parameterized queries. It is part of the Intelligent Query...
2023-06-26 (first published: 2023-06-08)
329 reads
Statistics are vitally important in allowing SQL Server to find the most efficient way to execute your queries. In this post we learn more about them, what they are...
2023-06-21
306 reads
Always Encrypted was a new encryption feature added to SQL Server with the 2016 version of the product. Initially it was just available in enterprise edition, but from SQL...
2023-06-21 (first published: 2023-06-05)
359 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