Issues with Execute Microsoft Sql Query Node after v3 upgrade

Describe the problem/error/question

After upgrading to v3 we are getting an issue where any nodes using execute SQL query which are using a table with a name like this: [Company$Table 1$123-456-789] . Is failing due to it thinking that $123 is a query parameter which hasn’t been set.

What is the error message (if any)?

The query references $123, but only 0 query parameter(s) are set

Information on your n8n setup

  • n8n version: 3.2
  • Database (default: SQLite): SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker compose
  • Operating system: Ubuntu 24.04 LTS

Hey @thomashopkins welcome to the community,
That’s the placeholder check the Microsoft SQL node now runs before every query. It looks for anything shaped like $ followed by digits and throws if there’s no query parameter for it. It skips matches inside single or double quotes, but it doesn’t treat square brackets as quotes, so the $123 in [Company$Table 1$123-456-789] gets read as a placeholder.

The quickest fix is to write those names with double quotes instead of brackets, like “Company$Table 1$123-456-789” (or dbo.“Company$Table 1$123-456-789”). SQL Server treats it as the same identifier, and the driver the node uses turns QUOTED_IDENTIFIER on by default. Same goes for any column name with a $ and digits in it. It’s still worth a GitHub issue, since bracketed names shouldn’t trip the check.

In n8n v3, the SQL query parser automatically scans for dollar-sign variables like $123 for parameterized queries, which breaks legacy table names containing symbols. You can bypass this by escaping the dollar signs as double dollar signs (e.g., $$123) within your SQL string to prevent the parser from treating identifiers as missing parameters. Let me know if escaping the table name resolves the binding error or if you need the exact syntax mapping for your query.

When dealing with MS SQL node issues after version upgrades, the culprit is often how connection pooling or parameter types are handled under the hood in newer Node.js database drivers. First, check if your connection string requires explicit encryption settings or trust server certificate flags, as newer updates tighten those defaults. You can also test wrapping your query in a standard Code node using a custom mssql library call just to isolate whether it is an n8n node parameter issue or a broader driver connectivity problem.

Thanks @Deepankar, that matches what I found. I opened a fix: fix(Microsoft SQL Node): Ignore $N inside [bracketed] identifiers in placeholder check by Sweta0519 · Pull Request #44132 · n8n-io/n8n · GitHub

The placeholder check skips $N inside '...' and "...", but not inside SQL Server [...] identifiers, so [Company$Table 1$123-456-789] gets read as a reference to $123. The PR makes the Microsoft SQL node treat bracketed identifiers like quoted text, with tests.

@thomashopkins until it ships, the double-quote form Deepankar gave works: "Company$Table 1$123-456-789"