Closed preneram closed 1 year ago
Have you tried connecting with autocommit=True
to see if that makes any difference?
Besides what Gord asked above, could there be permissions differences? Are you using the same login to the server?
Thank you for your replies! With "autocommit=True" the problem is solved in our use case. Does it mean pyodbc is always using transactions for any executed SQL if auto commit is not set True? Do I understand this right? It does something like:
begin transaction
exec dbo.LongRunningUspUsingTempdb @takesometime = 3600
commit transaction
Autocommit is by default off, hence you would need to commit transaction manually.
What could cause a problem with pyodbc and SQL Server tempdb?
When executing a user stored procedure on some database on SQL Server, tempdb properties are not accessible and templog shrinking (for processes running parallel) is somehow blocked. The usp makes use of tempdb during execution.
Therefore, templog is growing infinitely if there is no “close” while debugging (and temporarily during regular execution).
Running the same usp with Excel Power query has no influence on accessing tempdb properties.