SmartPaster
I recently discovered this great little free Visual Studio Add-in that allows pasting text as preformatted strings in VB or...
2012-02-02
820 reads
I recently discovered this great little free Visual Studio Add-in that allows pasting text as preformatted strings in VB or...
2012-02-02
820 reads
I just ran into an issue with one of my applications where a SQL statement had updated a status code...
2012-01-19
2,718 reads
This will be a series of handy hints for people that know SQL and are frustrated by Excel. I am...
2011-12-06
2,114 reads
Full disclosure: There might be a better way to do this. I am not aware of it.
Problems:
Maintaining multiple DB environments...
2011-11-03
1,468 reads
One of the databases that I support reports all money values in both the local currency and US Dollars. Very...
2011-10-28
15,197 reads
Tobias Ternstrom from Microsoft gave a great talk at Tech Ed regarding upcoming features of SQL Server Denali. His presentation...
2011-06-30
2,222 reads
(Yet another boring org chart example – except this one has multiple roots)
One of my apps has a hierarchial org chart...
2011-05-18
1,695 reads
If you want to test if you’re currently debugging an SSIS package via BIDS/Visual Studio, or running normally via DTExec,...
2011-04-28
2,412 reads
I was recently working on a data cleanup problem where I had to do lots of comparisons of one row...
2011-02-18
4,300 reads
I have two tables in an application that I support. One is called [Report], and the other is [ReportParameter].
--SAMPLE...
2011-01-27
19,139 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