I have a stored procedure that returns multiple tables (currently used by the web service). Now I need to paste this output into the SQL Server database.
I can insert one table if I know the existing definition through
INSERT INTO
EXEC ('myProcSQlhere')
But for this I need to know the definition of the output table in advance.
SELECT *
INTO
FROM OPENQUERY(SERVERNAME, 'EXEC myProcSQlhere')
Which overlooks knowledge of the definition of a table, but only allows you to enter into one table. So how do I insert data into multiple tables?
source
share