0
I need to read two tables in the database in order to compare them later, the code I did this giving error, because I am going through two queries in the same connection how could I be correcting this? Thank you.
import pyodbc
conn = pyodbc.connect("DRIVER={SQL Server};Server=localhost;database=teste;uid=;pwd=")
cursor1 = conn.cursor()
cursor1.execute("select top 10 * from tab1")
cursor2 = conn.cursor()
cursor2.execute("select top 10 * from tab2")
for row in cursor1:
print(row)
for row in cursor2:
print(row)