vscode-dbt-power-user
vscode-dbt-power-user copied to clipboard
Query preview not working for ODBC driver
Expected behavior
The preview feature should send a valid SQL query to my Fabric Synapse datawarehouse, using the ODBC Driver 18 for SQL Server. Running dbt, debugging, testing works as expected in the warehouse.
Actual behavior
The dispatched query is
select * from <table> limit 500
which is not valid T-SQL
Steps To Reproduce
In settings.json I first tried to set the query template:
"dbt.queryTemplate": "select top {limit} * from ({query}) as query"
I realized that the query template is deprecated, and set the field to blank, reinstalled extension, restarted VS Code etc.
Log output/Screenshots
Database Error
('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Incorrect syntax near '500'. (102) (SQLExecDirectW)")
Operating System
Windows 11
dbt version
1.8.7
dbt Adapter
Fabric
dbt Power User version
0.47.0
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Can confirm the same behaviour with dbt-sqlserver and ODBC Driver 17 for SQL Server. This started around Monday. Downgrading to a previous version didn't fix the issue either. Compile works though.
Probably relevant DBT Core issue?
https://github.com/dbt-labs/dbt-core/issues/10843
I was able to make it work again by downgrading to: dbt-core 1.7.18 dbt-fabric 1.7.4 on Power User for dbt v0.47.0
I was able to make it work again by downgrading to: dbt-core 1.7.18 dbt-fabric 1.7.4 on Power User for dbt v0.47.0
I confirm that in my case it also solved the issue. I had tried downgrading but only the dbt-sqlserver library and not the core.
https://github.com/microsoft/dbt-fabric/issues/216
A fix has been pushed for this issue, but a new version has not been released.