Scripts

Technical Article

T-SQL Table Valued Function to compare Semantic Versions

Semantic versioning (SemVer) is a standardized system for labeling software releases using a three-part number—major, minor, and patch—optionally followed by pre-release labels and build metadata. Comparing semantic versions is complex because it requires handling both numeric and string components, as well as special precedence rules for pre-releases and stable versions. SQL Server’s hierarchyid data type is ideally suited for comparing the numeric parts of semantic versions, enabling efficient and accurate ordering without the pitfalls of string comparison or manual parsing.

5 (1)

You rated this post out of 5. Change rating

2025-05-27

41 reads

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

483 reads

Blogs

SQL Blunders: Stop Writing These Pointless Queries & Write Smarter!

By

They run, they return data. So what? Some SQL queries just waste your time...

Copilot Outside of SSMS Seems to Work

By

I read Brent’s first look at SSMS and Copilot in there. He didn’t have...

A New Word: Falesia

By

falesia– n.  the disquieting awareness that someone’s importance to you and your importance to...

Read the latest Blogs

Forums

Question about updating statistics

By SQL Guy 1

We have very large tables in our database, some even more 1 B records,...

Greener Grass

By Grant Fritchey

Comments posted to this topic are about the item Greener Grass

What tool or tools do people like for monitoring SQL servers?

By tschgc

I have a few tools at my disposal but none of them seems like...

Visit the forum

Question of the Day

A Basic Data API Builder ADD

What parameters are required for the dab add command in the Data API Builder?

See possible answers