Error syncing fields for all tables in SQL Server unless using case-sensitive exact database name #25510
Labels
Administration/Metadata & Sync
.Backend
Database/SQLServer
Priority:P3
Cosmetic bugs, minor bugs with a clear workaround
Type:Bug
Product defects
Describe the bug
Metabase is able to connect to the SQL Server instance and query the list of tables, but it is not able to obtain any information about the columns.
As such, when building a question, no columns are available and it is not possible to use this feature. SQL Queries however, do work properly.
Each table in the database results in an error: The database name component of the object qualifier must be the name of the current database.
No columns are synced into Metabase.
Logs
This is an example log for one table. This occurs for every table in the database:
Click to expand logs
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect that the database tables and columns sync properly.
Screenshots
In the Data Model section, the list of columns is complete, however every table has an empty schema.
Information about your Metabase Installation:
You can get this information by going to Admin -> Troubleshooting.
Severity
This restricts our usage of Metabase to SQL Queries because without any schema information, Metabase knows about the tables but not the columns, therefore using Questions does not work.
Additional context
I tried to read through the driver code in metabase/driver/sql_jdbc/sync/describe_table and followed it down into the MSSQL JDBC code where it seems like
sp_columns_100
is being called.I tried to reproduce this error by executing the same stored procedure from within a Metabase SQL Query. Oddly, it seems to work if I change the database name to uppercase.
So at this point I'm not sure if this is an issue in Metabase, MS SQL JDBC, or even something specific to MS SQL Server 2016.
There is also a Microsoft JDBC Driver issue that might be relevant about this error being returned when a stored procedure is called from a different database.
The tables I am syncing are named like
My Organization$Some Table
in the databaseMYDB
and schemadbo
.This is the sample code that the reporter of that issue posted:
Click to sample code
The text was updated successfully, but these errors were encountered: