SQLServerCentral Editorial

The September Energy Update

I think you'll be happy to know that there are interesting people out there. One of my neighbors, maybe a couple miles away, has a windmill that I've watched run regularly as I drove my daughter to school all last year. I finally grabbed their address one day and wrote them a letter, not wanting to just walk up to their door with a list of questions. I waited patiently for a couple weeks and finally got an email.

SQLServerCentral Editorial

Free Training

I heard on Thursday a couple weeks ago that someone who had received a free admission to the PASS conference had cancelled and wasn't able to attend. It was last minute and that pretty much ruled out any chance to have a contest, so I called a friend in Denver who's a DBA and doesn't get much of a budget for training. I offered him the admission and he said he'd let me know Friday.

SQLServerCentral Editorial

Billy-yons and Billy-yons of Records

There was an article last week with a great title: The Mother of All Genealogy Databases, and so I had to take a look at it. It talks about some of the large databases on the Internet that are collection public records and linking them together to help people find out about their individual and family histories. The largest site so far, Ancestry.com, supposedly has 5 billion records.

Blogs

The FinOps Lifecycle: From Budgeting to Reporting

By

Working in DevOps long enough teaches you two universal truths: That’s exactly why I...

Finding and Updating Duplicate IDs: #SQLNewBlogger

By

Finding duplicates was an interview question for me years ago, and I’ve never forgotten...

Optimising Costs: Strategies for Efficient Cloud Resource Management

By

Over time, I’ve realised that one of the hardest parts of cloud management isn’t...

Read the latest Blogs

Forums

Fun with JSON II

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Fun with JSON II

Changing Data Types

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Changing Data Types

Answering Questions On Dropped Columns

By Cláudio Silva

Comments posted to this topic are about the item Answering Questions On Dropped Columns

Visit the forum

Question of the Day

Fun with JSON II

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