The Bit Bucket

SQL: Understanding Change Data Capture for Azure SQL Database - Part 5 - Accessing CDC from another database

This is the final part of a series on using Change Data Capture with Azure SQL Database, and looks at accessing the data from change data capture from another database.

Scenario

I often use Azure SQL Database as a data warehouse. It’s a perfectly fine database for that. But the challenge with Azure SQL Database is always about how to access data in other databases.

Many people don’t seem to realize that you can use External Tables (and External Data Sources) to read data in one Azure SQL Database, in another Azure SQL Database.

2024-01-22

Fabric Down Under show 6 with guest Paul Turley now available!

Once again, I had the great pleasure to record a Fabric Down Under podcast with a fellow long-term Microsoft Data Platform MVP. This time it was someone I have known for a long time: Paul Turley.

Paul is a director at 3Cloud and a Microsoft MVP. Paul has an amazing level of experience with business intelligence projects and has also worked with Microsoft Fabric since it was just a twinkle in Microsoft’s eye.

2024-01-15

SQL Server Locking, Blocking, and Deadlocks for Developers and DBAs Course Released

The latest online on-demand course that I’ve been working on is now out the door. SQL Server Locking, Blocking, and Deadlocks for Developers and DBAs is available at our site: SQL Server Locking, Blocking and Deadlocks for Developers and DBAs (sqldownunder.com)

It’s designed to let you learn to find and fix locking issues, and to avoid them in the first place.

To celebrate the release, use coupon code LOCKINGRELEASE until January 20th to get 25% off the price.

2023-12-31

Fabric Down Under show 5 with guest Reid Havens now available!

I had the great pleasure to record a Fabric Down Under podcast with Microsoft MVP Reid Havens the other day.

Reid is the founder of Havens Consulting Inc. and a Microsoft MVP, and a seasoned professional with a wealth of experience in technology, organizational management, and business analytics. Reid teaches Business Intelligence, reporting, and data visualization, and that’s what I wanted to talk to him about.

Reid is the founder of Havens Consulting Inc. and a Microsoft MVP. Reid is  a seasoned professional with a wealth of experience in technology, organizational management, and business analytics. Reid has a Master’s Degree in Organizational Development and a background in consulting for Fortune 10, 50, and 500 companies.

2023-12-19

SQL Down Under show 84 with guest Rob Sewell discussing SQL Server command line utilities is now published

I know it’s been a while, but there’s a new SQL Down Under show published!

While I’ve been busy with https://cosmosdownunder.com and https://fabricdownunder.com , I haven’t forgotten the SQL Down Under shows. It’s time for some more SQL Server love.

I had the great pleasure yesterday to record a podcast with one of my UK based friends Rob Sewell. Rob’s one of the rare breed that is both a Data Platform MVP and an Azure MVP.

2023-11-11

Fabric Down Under show 4 with guest Will Thompson discussing Data Activator in Microsoft Fabric

I had the great pleasure to get to spend time today, talking with Will Thompson. We were discussing Data Activator in Microsoft Fabric. Data Activator has just entered public preview.

Will is a Program Manager at Microsoft, where he’s working as part of the Microsoft Fabric team. During the show, Will discusses the two typical use cases for Data Activator: one that’s about taking action on standard analytics, and one that’s about working with streaming data.

2023-10-13

SQL: Even more details on finding rows that have changed using HASHBYTES and FOR JSON PATH

In a previous post, I wrote about how to create a hash of all the columns in a table, by using FOR JSON PATH and HASHBYTES. This is incredibly useful if you need to check if incoming data is different to existing table data.

The code that I suggested (based on WideWorldImporters) was as follows:

SELECT po.PurchaseOrderID,
       HASHBYTES('SHA2_256', pod.PurchaseOrderData) AS HashedData
FROM Purchasing.PurchaseOrders AS po
CROSS APPLY
(
    SELECT po.*
    FOR JSON PATH, ROOT('Purchase Order'), INCLUDE_NULL_VALUES
) AS pod(PurchaseOrderData);

The challenge with that code though, is that for the existing table data, it’s best calculated when the data is stored, rather than every time it’s queried. And, bonus points if you then create an index that holds just the key for matching plus an included column for the HashedData. With a bit of careful work, you can get an efficient join happening to find differences.

2023-10-09