question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mssql+pyodbc Error: Connection is busy with results for another command

See original GitHub issue

Hello,

this project seems really useful, but sadly, I can’t get it to work with MSSql over odbc. SqlAlchemy itself works fine with this setup, but I cannot execute a single query with ipython-sql. Maybe ipython-sql does a query without fetching the results? ODBC+MSql does not like that.

%%sql mssql+pyodbc://@myDSN SELECT TOP 100 * FROM SomeDB.dbo.tbl_sometable;

(pyodbc.Error) ('HY000', '[HY000] [Microsoft][SQL Server Native Client 11.0]Connection is busy with results for another command (0) (SQLExecDirectW)') [SQL: 'commit']

  • ablepharus

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:17

github_iconTop GitHub Comments

23reactions
jgeo23commented, Nov 22, 2017

In the connection string, try setting MARS_Connection=Yes

6reactions
waltertschwecommented, Nov 6, 2018

MARS_Connection=Yes

is case sensitive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why only some users get the error: "Connection is busy with ...
The "Connection is busy with results for another command" error means that there are at least two queries that use the same connection....
Read more >
Lesson Learned #229: Hands-On-Labs - Connection is busy ...
Happens when you have an active process (DataReader) and you try to run another process (SELECT). Example: /* using System; using System.
Read more >
Why do I receive "[Microsoft][ODBC SQL Server Driver ...
“[Microsoft][ODBC SQL Server Driver]Connection is busy with results for ... another EXEC command using the same connection, you will get this error message....
Read more >
"Connection is busy with results for another command" error
Re: SQL Server ODBC: "Connection is busy with results for another command" error ... If you are using OLE DB , rather than...
Read more >
Database connection is busy with results from another command
There is issue with your connection string of your database. So, you only need to make "MARS_Connection=yes". It will work.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found