The SSMS Super Clipboard (Day 13)
We’re all used to using the clipboard in Windows programs. You copy something into it with Ctrl+C, and paste it...
2018-01-13
387 reads
We’re all used to using the clipboard in Windows programs. You copy something into it with Ctrl+C, and paste it...
2018-01-13
387 reads
In yesterday’s tip, I showed an example of changing a block of text from upper case to lower case. However,...
2018-01-12
280 reads
While Regular Expressions lets us work with text not cleanly formatted, if you are trying to work with text that...
2018-01-11
236 reads
Have you ever downloaded a script from an internet site, only to find that there are extra blank lines between...
2018-01-10
452 reads
Have you ever had to run a query on multiple servers? You could connect to each server one by one...
2018-01-09
430 reads
Have you ever had a script where you needed to run parts of it on different instances of SQL Server...
2018-01-08
435 reads
Do you have scripts that you need to run frequently, but every time you need to set some different parameters?...
2018-01-18 (first published: 2018-01-07)
1,543 reads
Have you ever had a long script that you are trying to scroll through? Do you wish that you could...
2018-01-06
546 reads
So you’re working with a query that you have loaded from a saved file. And now you want to open...
2018-01-05
366 reads
Have you ever been working in SSMS where you need to frequently access one particular script, but you are spending...
2018-01-04
418 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