We want call a Stored procedure which returns 4 tables in my Stored procedure.To create dynamic table in my sp I am using OPENROWSET. While executing my new sp i am getting Column name or number of supplied values does not match table definition. exception.

When I debugged my code the dymanic table whic is getting created is having columns for the first table only.

Edit 1:

Create table #temp 'SELECT * FROM OPENROWSET( 'SQLNCLI', 'DRIVER={SQL Server};', 'EXEC spreturninngfourtable')

Insert into #temp 'EXEC spreturninngfourtable'


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.