Constraints and declarative referential integrity
Database systems have powerful features built right in that can ensure the integrity of data. In this article, Joe Celko discusses keys and constraints.
2021-05-28
Database systems have powerful features built right in that can ensure the integrity of data. In this article, Joe Celko discusses keys and constraints.
2021-05-28
Greg Larsen continues his series and shows how user-defined roles roles can control SQL Server security.
2021-05-24
Organizations have many choices when it comes to databases. In this article, Robert Sheldon explains how to choose between SQL and NoSQL databases.
2021-05-19
In this article we look at using Window Functions in SQL Server, Oracle and PostgreSQL to see the differences and similarities of the syntax.
2021-04-19
This month, to mark the 20th anniversary of BrentOzar.com, Brent steps back and looks at the big picture.
2021-04-06
There are certain checks that need to be done after a database migration is complete. One good example of this is the check that a migration script, such as one that merges changes from a branch into main, doesn't cause 'invalid objects' (a.k.a. 'missing references') in your databases. I'll show you how to run this check, using sp_RefreshSQLModule, and incorporate it into a Flyway "after" migration script.
2021-03-25
In this article we walk through how to connect to Azure SQL Database using Azure Active Directory authentication along with multi-factor authentication.
2021-03-19
Phil Factor provides SQL routines to extract data from and load data into a SQL Server database, using BCP, and then a PowerShell automation script that uses Flyway to automatically build a database, from scratch and then fill it with data, ready for testing.
2021-03-10
Learn how to setup and use Azure SQL Data Sync to synchronize and replicate data from various locations including Azure SQL Database, cloud and on-premises databases.
2021-03-02
There's just 1 week left until the Redgate Summit: The Future of Database DevOps. Check out this blogpost for what's in store, spoilers from our speakers on what they're most excited to share on the day, and why you should attend.
2021-02-09
By Brian Kelley
I will be leading an in-person Certified Information Systems Auditor (CISA) exam prep class...
EightKB is back again for 2026! The biggest online SQL Server internals conference is...
By HeyMo0sh
Working in DevOps long enough teaches you two universal truths: That’s exactly why I...
Hi all, I just started using VS Code to work with DB projects. I...
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
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