sqlalchemy throw out DBAPIError: Changed database context

Viewed 19

I have a query written in this way:

query = """

set nocount on;

use my_database;

select x, y, z from my_database.dbo.my_data_table 

"""
df = pd.read_sql(engine, query)

This code runs perfectly fine on my local windows workstation. However, when it runs on a Linux VM , it kept throwing out a error saying

cursor.execute(statement, parameters)\nsqlalchemy.exc.DBAPIError: (pyodbc.Error) 

('01000', \"[01000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Changed database context to 'my_dababase'. (5701) (SQLParamData)\")

On my windows workstation, I used my windows login to create the engine, while in the linux VM, although it uses a different login, but the default database / schema are the same. I was wondering if someone can help to point out why there would be an error like this. Thanks.

0 Answers
Related