Finding Untrusted Foreign Keys and Constraints
In the previous blog, we discussed the Foreign Keys Constraints and how the CHECK Constraints are useful to verify the...
2018-04-30 (first published: 2018-04-19)
3,146 reads
In the previous blog, we discussed the Foreign Keys Constraints and how the CHECK Constraints are useful to verify the...
2018-04-30 (first published: 2018-04-19)
3,146 reads
This blog demonstrates attaching a database on the SQL Server Instance which already has the same name database up and...
2018-04-23
1,814 reads
DMV (Database Management View) and DMO (Database Management Objects) were added in 2005. There have been huge improvements in each...
2018-04-16
25,953 reads
Recently, while reviewing one of the stored procedure performance, I suggested a couple of changes to a developer to improve...
2018-04-12
19,610 reads
Yesterday, I was attending a database design meeting. In the meeting, I was asked one of the questions – “How many...
2018-04-12 (first published: 2018-04-05)
12,086 reads
If you are working on SQL Server optimization delicately, you may get often queries that how to find if any...
2018-04-09
964 reads
It is relatively easy to spot CPU-bound system. But, the source of CPU pressure is not always easy to pinpoint....
2018-04-02
1,252 reads
It is fun working with SQL/Application developer where you exchange a lot of technical thoughts to find the root of...
2018-03-21
7,311 reads
For SQL Server 2017 RTM, the fourth cumulative update was released on 20th February, and it is available for download...
2018-03-08 (first published: 2018-03-01)
1,599 reads
With the release of SQL Server 2017 CU4, you can use the mssql-conf utility to move the master database file...
2018-03-07 (first published: 2018-02-23)
2,084 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