Skip to content
Advertisement

Table get locked when called an SQL Server SP from pyodbc Python [closed]

Table get locked when called an SQL Server SP from pyodbc Python

I have a table I made for testing called test. I just want to see if my code works. My python code is very simple and only calls one SP

Here is my SQL Server SP script:

and my python code is this:

Before running the python code I ran this select

and the output was 4 records

I ran the python script and I got this output

which means record been inserted and total number of records is 5

but when I run the

I still get 4 records only

and when I try

I get timed out.

How to fix that?

Advertisement

Answer

read_sql won’t commit the transaction. You need to explicitly commit it.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement