T-SQL HOST_ID and HOST_NAME
HOST_ID and HOST_NAME
Included in T-SQL for SQL Server is a functions that returns the workstation information that executes a SQL...
2015-04-20
3,519 reads
HOST_ID and HOST_NAME
Included in T-SQL for SQL Server is a functions that returns the workstation information that executes a SQL...
2015-04-20
3,519 reads
SQL Server 2014 Deprecated Features – Database Engine
Everyone looks at the new features when trying to determine when to upgrade from...
2015-03-19
2,037 reads
Call for speakers is now open for SQL Saturday #408 in Houston, TX. If you are interested in presenting please...
2015-03-13
897 reads
What is the Azure Data Factory?
The Azure Data Factory is a managed service for data storage and processing. It allows...
2015-03-10
1,396 reads
T-SQL EXCEPT and INTERSECT
Both T-SQL EXCEPT and INTERSECT are set based operators that combine multiple query results back in the same...
2015-03-03 (first published: 2015-02-23)
9,016 reads
T-SQL UNION
Set operators allow you to combine data from two or more queries and return the results in a single...
2015-02-13 (first published: 2015-02-04)
8,666 reads
SSRS Farm Overview
Building a SSRS farm will require Enterprise or Business Intelligence editions of SQL Server for versions 2012 and...
2015-01-26
1,366 reads
T-SQL Random Numbers using RAND()
SQL Server includes the T-SQL RAND() function to create a random value between 0 and 1...
2015-01-12
1,386 reads
T-SQL COALESCE
SQL Server T-SQL coalesce simplifies the use of a case statement to find the first non-null value of your...
2014-12-30 (first published: 2014-12-26)
9,006 reads
Row_Number SQL Server
SQL Server includes several Ranking Functions that can be called in T-SQL. One of these is the Row_Number()...
2014-12-22 (first published: 2014-12-16)
8,850 reads
By HeyMo0sh
Working in DevOps long enough teaches you two universal truths: That’s exactly why I...
By Steve Jones
Finding duplicates was an interview question for me years ago, and I’ve never forgotten...
By HeyMo0sh
Over time, I’ve realised that one of the hardest parts of cloud management isn’t...
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