[ACCEPTED]-Access second result set of stored procedure with SQL or other work-around? Python\pyodbc-pyodbc
Accepted answer
No need for anything fancy. Just use nextset:
import pyodbc
db = pyodbc.connect ("")
q = db.cursor ()
q.execute ("""
SELECT TOP 5 * FROM INFORMATION_SCHEMA.TABLES
SELECT TOP 10 * FROM INFORMATION_SCHEMA.COLUMNS
""")
tables = q.fetchall ()
q.nextset ()
columns = q.fetchall ()
assert len (tables) == 5
assert len (columns) == 10
0
There are a few possible methods here. If the 3 result sets are all the same, you might 2 be able to use the INSERT...EXEC method. Otherwise 1 OPENQUERY might work.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.