I’m reviewing a 5-year old Jupyter runbook that uses Python cells, that used to be able to execute SQL queries if the Python cell was opened with
%%sql mssql+pyodbc://mssqlserver/databasename?driver=SQL+Server+Native+Client+11.0?Trusted_Connection=yes;AutoCommit=false;
When I run that cell now, Python dumps a stack which contains the error messages
pyodbc.Error: (‘IM012’, ‘[IM012] [Microsoft][ODBC Driver Manager] DRIVER keyword syntax error (0) (SQLDriverConnect)’)
sqlalchemy.exc.DBAPIError: (pyodbc.Error) (‘IM012’, ‘[IM012] [Microsoft][ODBC Driver Manager] DRIVER keyword syntax error (0) (SQLDriverConnect)’)
I’ve tried massaging the driver name (with “{}”, without, with “+”, without) and specifying other drivers, such as {SQL+Server} and {ODBC+Driver+18+for+SQL+Server} but the same error always pops.
jaymeer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1