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: )

446 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: )

808 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

377 reads

Technical Article

Comprehensive SQL Performance Monitoring and Optimisation Script

This script monitors and reports the execution statistics of SQL statements over a specified period, capturing metrics such as execution counts, CPU time, I/O operations, and elapsed time. It provides a comprehensive view of query performance, aiding in the diagnosis of performance issues and identifying problematic SQL queries in the database.

5 (1)

You rated this post out of 5. Change rating

2024-07-29 (first published: )

1,859 reads

Blogs

SQL Server Wait Stats

By

Everything in SQL Server is waiting for something…this is by design. And most people...

FabCon 2025 Recap

By

Hey fellow data friends! Wow, March was an absolutely crazy month (in the best...

Privacy Policy

By

We value your privacy. This policy explains what personal data we collect and why. What...

Read the latest Blogs

Forums

Trouble accessing hidden XML download link on Blazor-based government site

By Jobs90312

Hey everyone, I'm trying to access an XML file download from a government website...

Index is only used for statistics in query plan

By michel.zdw

Hi, I have very large table (6 * 10^9 records) where i have 4...

Visit the forum

Question of the Day

Importing Flat Files

What types of sources can be used with the Import Flat File Wizard in SQL Server Management Studio (SSMS)?

See possible answers