Which cardinality estimator (CE) was used in my query?
SQL Server 2008 is reaching end of support this year, so upgrading your SQL Server might be on your mind....
2019-02-25
582 reads
SQL Server 2008 is reaching end of support this year, so upgrading your SQL Server might be on your mind....
2019-02-25
582 reads
The series is alive! It’s been a while since I last talked about memory grants. Don’t worry, I still care...
2019-02-21
399 reads
I didn’t expect anything for free in index maintenance. After all, it takes a lot of CPU and transaction log...
2019-02-20 (first published: 2019-01-30)
2,417 reads
Yesterday’s post talked about single use plans. The statements I’m using are also called ad hoc queries. The alternative to...
2019-02-20
321 reads
So, we’ve set up a table with table partitioning on the RIGHT for CreationDate. We defined 11 partitions, and in...
2019-02-18
162 reads
Happy Friday! Today’s post will be light on the performance side and instead, I’m going to talk about how to...
2019-02-15
1,747 reads
This is the sequel to “It’s always parameter sniffing (part 1).” In that post, we identified the stored procedure, and...
2019-02-14 (first published: 2019-01-23)
2,513 reads
In Partitioning 1, my query searched through all 1-12 partitions. Let’s see if we can reduce that number.
Adding the partitioning...
2019-02-13
1,631 reads
This month’s T-SQL Tuesday is hosted by Andy Leonard at andyleonard.blog . Andy asks us, what is your “Why?”
So what is...
2019-02-12
685 reads
Proceed with caution, if you’re thinking of using query hints. This post will specifically cover min_grant_percent and max_grant_percent.
My opinion on...
2019-02-11 (first published: 2019-01-22)
10,010 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