Insert values for columns in a table from few stored procedures

  • I have a table with say 10 columns and 8 columns need to pull the data from 8 different stored procedures. I would need just one column from the stored procedure that is returning say 8-10 columns as the result set(i.e the stored procedure is not returning just one column but multiple columns).

    How do I populate columns in a table from stored procedures?
    I have used OPENQUERY but that affects the performance since it uses linked server.
    What would be the best way to handle the above scenario?

    Thanks

  • What exactly are you trying to do?  Run a SP on another server and use the results on on the current server?

  • Thanks for the reply. Both the stored procedure and table name are on the same server.

  • create temp tables or table variables and execute-insert each procedure, query the temp tables or table variables to insert into the target table.
  • This was removed by the editor as SPAM

  • subramaniam.chandrasekar - Wednesday, January 10, 2018 11:53 PM

    happy55 - Wednesday, January 10, 2018 12:19 PM

    I have a table with say 10 columns and 8 columns need to pull the data from 8 different stored procedures. I would need just one column from the stored procedure that is returning say 8-10 columns as the result set(i.e the stored procedure is not returning just one column but multiple columns).

    How do I populate columns in a table from stored procedures?
    I have used OPENQUERY but that affects the performance since it uses linked server.
    What would be the best way to handle the above scenario?

    Thanks

    Please could you use T SQL, wherever you want the columns to be populated, Please use variables / parameters.

    Thanks but I have to use stored procedures as those are already being used and we don't want to duplicate code and write sql queries .

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply