- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2026 03:50 AM
Hi @Alessio_F ,
This happens because in Databricks SQL both year and month functions are just aliases over following patterns:
- extract (YEAR FROM expr)
- extract(MONTH FROM expr)
When Databricks pushes a predicate or expression down to the remote SQL Server via JDBC, it translates these functions back to their canonical EXTRACT(...) form - which is not a recognized in SQL Server's T-SQL dialect.
You can try to rewrite your query or you can try to use remote_query() function which lets you run SQL queries directly against external database using native SQL syntax of th remote system.
Query external databases using the remote_query function | Databricks on Google Cloud
If my answer was helpful, please conisder marking it as accepted solution.