I am trying to use Python to call a SQL query, with pyodbc.
It worked fine in the following way:
import pyodbc
import pandas.io.sql as psql
server_name = 'My_Server'
database_name = 'My_DB'
conn = pyodbc.connection("driver={SQL Server};server=" + server_name + ";database=" + database_name + ";trusted_connection=true")
sql_command = """ EXEC MY_DB.dbo.some_proc"""
df = psql.read_frame(sql_command, conn)
It was ok when some_proc returns only one table. But what can I do if some_proc returns multiple tables, e.g. two tables?
Many thanks.
select * from tab_xxx. However, due to the development requirement, it can be only called once. So it returns two sets of results at the same time.