I'm trying to use SqlAlchemy with PyOdbc using the Microsoft ODBC Driver for Linux, but when I use the session.query() function, I get the following error:
pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid object name 'TableName'. (208) (SQLExecDirectW)")
So I saw that the query created by orm had square brackets on TableName.
SELECT
[mb.Tecnico].cod_tecnico AS [mb.Tecnico_cod_tecnico],
[mb.Tecnico].nome AS [mb.Tecnico_nome],
[mb.Tecnico].login AS [mb.Tecnico_login],
[mb.Tecnico].senha AS [mb.Tecnico_senha]
FROM
[mb.Tecnico]
ORDER BY
[mb.Tecnico].nome
TableName? - SqlZimmb.Tecnicoand is that the value of TableName in your error message? - Alex K..). The error either means you are connected to the wrong database or the table is bound to a schema that you are not specifying. - Alex K.