โ03-10-2026 06:44 AM
Hey all,
I have some rather basic C# code that I'm running against the newest DataBricks ODBC driver, attempting to insert parameterized queries.
I see the option to disable parameterized queries in the documentation. UseNativeQuery=false, FastSQLPrepare=false. SparkThriftServer, OAuth with passthrough token, SSL=true, but nothing else configured.
I can query this and other tables just fine and I can insert with SQL literals, but parameterization seems broken.
Any feedback would be appreciated
Forgive the formatting, but it's pretty much basic ODBC use with parameterized queries.
Thanks a lot!
โ03-10-2026 11:43 AM
Hi,
I haven't come across this issue myself but according to some internal resources I think the following fix may work.
This is a known issue introduced in ODBC driver version 2.8.0. The root cause is that the default for EnableNativeParameterizedQuery was changed from 1 to 0 in that release (to protect Power BI users). Without it, the driver's client-side SQL parser tries to rewrite parameterized queries but fails on DML statements like INSERT โ it sends unresolved internal parameter names (_53, _67, etc.) to the server, which causes the UNBOUND_SQL_PARAMETER error.
SELECT queries work because the driver's ANSI SQL-92 parser handles simple SELECT parameterization, but INSERT/DML and complex SQL (CTEs, CASE WHEN, etc.) are not reliably handled by the client-side parser.
The fix is to add these two settings to your connection string:
UseNativeQuery=1;EnableNativeParameterizedQuery=1;
For C# OdbcConnection, these must be in the connection string itself, not just the DSN configuration. So your connection string should look something like:
Driver={Databricks};Host=...;Port=443;HTTPPath=...;AuthMech=11;Auth_Flow=0;Auth_AccessToken=...;SSL=1;UseNativeQuery=1;EnableNativeParameterizedQuery=1;
FastSQLPrepare is unrelated to this issue and won't help here.
If you're on an older driver version, I'd also recommend updating to 2.9.1+ as there have been additional fixes for parameterized query handling.
I haven't been able to test this so if it works please mark as accepted solution to help others.
โ03-10-2026 06:46 AM
I should probably add that I've tried to downgrade to the last Simba driver and that doesn't support transactions which are kinda required in my scenario. Thanks again!
โ03-10-2026 11:43 AM
Hi,
I haven't come across this issue myself but according to some internal resources I think the following fix may work.
This is a known issue introduced in ODBC driver version 2.8.0. The root cause is that the default for EnableNativeParameterizedQuery was changed from 1 to 0 in that release (to protect Power BI users). Without it, the driver's client-side SQL parser tries to rewrite parameterized queries but fails on DML statements like INSERT โ it sends unresolved internal parameter names (_53, _67, etc.) to the server, which causes the UNBOUND_SQL_PARAMETER error.
SELECT queries work because the driver's ANSI SQL-92 parser handles simple SELECT parameterization, but INSERT/DML and complex SQL (CTEs, CASE WHEN, etc.) are not reliably handled by the client-side parser.
The fix is to add these two settings to your connection string:
UseNativeQuery=1;EnableNativeParameterizedQuery=1;
For C# OdbcConnection, these must be in the connection string itself, not just the DSN configuration. So your connection string should look something like:
Driver={Databricks};Host=...;Port=443;HTTPPath=...;AuthMech=11;Auth_Flow=0;Auth_AccessToken=...;SSL=1;UseNativeQuery=1;EnableNativeParameterizedQuery=1;
FastSQLPrepare is unrelated to this issue and won't help here.
If you're on an older driver version, I'd also recommend updating to 2.9.1+ as there have been additional fixes for parameterized query handling.
I haven't been able to test this so if it works please mark as accepted solution to help others.
โ03-10-2026 12:37 PM
@emma_s Thank you so much! This resolves the issue for me.