Scripts

Technical Article

Real-Time SQL Server to BigQuery Streaming ETL using CDC

CDC Changes: The script queries the CDC tables in SQL Server to retrieve the changes (inserts, updates, deletes) since the last sync. Each change is processed with a mapped operation type (INSERT, UPDATE, DELETE).
Real-Time Streaming to BigQuery: The captured changes are streamed directly to BigQuery using its real-time insert_rows_json method, avoiding the need for batch uploads via Google Cloud Storage.
Tracking Last Sync Time: The script tracks the last synchronization time and updates it after every successful sync, ensuring no data is missed.
Low Latency: By continuously querying the CDC tables and streaming the changes, the script achieves near real-time data synchronization.

5 (1)

You rated this post out of 5. Change rating

2024-11-13 (first published: )

468 reads

Technical Article

Concatenating Multiple Row Values into a Single Comma-Separated List

In scenarios where you need to consolidate multiple rows into a single, comma-separated value, you can achieve this using FOR XML PATH. This script demonstrates how to retrieve volunteer data and display the days they have selected for participation.

You rated this post out of 5. Change rating

2024-11-11 (first published: )

870 reads

Technical Article

While Loop in T-SQL

Often, we encounter situations where we need to loop through a dataset to process or update records iteratively. In such cases, I use WHILE loop like below. The example below demonstrates how a WHILE loop can be used to iterate Sales records. This approach is particularly effective when working with a numerical or date column, […]

3 (2)

You rated this post out of 5. Change rating

2024-10-15

401 reads

Blogs

A New Word: Lookaback

By

lookaback– n.  the chock of meeting back up with someone and learning that your...

Azure Vulnerability Assessments

By

Regarding managing databases in the cloud, security should never be an afterthought. That’s where...

Speaking at the NYC Lunch and Learn–May 23

By

In a couple of weeks, I’ll be in New York City for the Redgate...

Read the latest Blogs

Forums

How Do You Know You Are Right?

By Louis Davidson (@drsql)

Comments posted to this topic are about the item How Do You Know You...

continuous membership

By smattiko83

Hi, I am trying to find everyone who had membership for a continuous year...

Migrating data from using ManagerId to HierarchyId

By edwardwill

I have a table called Person with the following schema: CREATE TABLE [People].[Person]( [Id]...

Visit the forum

Question of the Day

Decoding the Collation II

In a collation setting, like Latin1_General_100_CI_AS_KS_WS_SC_UTF8, what does the WS mean?

See possible answers