Skip to content

Fix: Escaping CDC function names in SQL queries#90

Open
AzerQ wants to merge 1 commit intoDAXGRID:masterfrom
AzerQ:fix-escaping-cdc-function-name
Open

Fix: Escaping CDC function names in SQL queries#90
AzerQ wants to merge 1 commit intoDAXGRID:masterfrom
AzerQ:fix-escaping-cdc-function-name

Conversation

@AzerQ
Copy link

@AzerQ AzerQ commented Dec 25, 2025

Problem:
When using SQL Server Change Data Capture (CDC) functions in SQL queries, if capture instance names or other object identifiers contain special characters or reserved keywords, a SQL syntax error may occur when constructing dynamic SQL queries.

Solution:

  1. Added EscapeSqlServerObjectName() function to properly escape SQL Server object identifiers
  2. Function wraps each part of the object name (separated by dots) in square brackets []
  3. Updated GetChangesAsync() method to use the escaped CDC function name in SQL queries
  4. Added System.Linq dependency for LINQ method usage

Changed Files:

  1. CdcDatabase.cs: addition of escaping function and its usage in SQL queries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant