SQL Server – Various methods to generate unique number sequence
Hi all, Friends, most of the time we used ranking function like ROW_NUMBER() when it required to generate unique number...
2015-09-28
654 reads
Hi all, Friends, most of the time we used ranking function like ROW_NUMBER() when it required to generate unique number...
2015-09-28
654 reads
HI friends, in some working scenario or during interviews we got the task to find the running totals of a...
2015-09-14
607 reads
Hi friends, I was working on a scenario in which I need to assign a unique values to a column....
2015-09-08
621 reads
Hi friends, in our day to day work we used SELECT…INTO clause to create replica of a table for different...
2015-08-03
666 reads
Hi friends, As you all know that SQL Server CTP2 has released with new great features. Here is the list of...
2015-07-26
674 reads
Sys.dm_exec_query_stats is most commonly used DMO used by DBA and developers to find out the information about queries involving query...
2015-07-25
646 reads
In SQL Server 2014 a new feature In-Memory OLTP was introduced which was referred as ‘Hekaton’. This feature was introduced...
2015-07-23
735 reads
Hi friends, today I will get you introduced with another new feature of SQL Server 2016 i.e. Temporal Tables. SQL...
2015-07-23 (first published: 2015-07-20)
3,096 reads
Hi friends, today we will continue with Query Store in SQL Server 2016. In previous blog we learnt about what...
2015-07-17
1,107 reads
Hi friends, in next few blogs we will explore another new feature named Query Store which gets introduced in SQL...
2015-07-16
709 reads
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...
By Brian Kelley
If your organization is spending money, then meaningful results are a must. Pen testing...
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