﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / how to get output from stored procedures / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 06:07:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>Good luck, blue.    It's really not difficult, just tedious and time consuming.</description><pubDate>Tue, 04 Aug 2009 07:24:15 GMT</pubDate><dc:creator>The Dixie Flatline</dc:creator></item><item><title>RE: how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>Thank you all for responding. Yes, DCPeterson, creating that many temp tables is what I was afraid of. I will look into Matt's suggestion, but I'm not sure it would be any easier.And Quickly Confused is right, there is no auto way to do thissince none of the stored procedure output have the common columns.This is what I needed to hear before I proceed. thanks a bunch.</description><pubDate>Mon, 03 Aug 2009 20:46:27 GMT</pubDate><dc:creator>sqlblue</dc:creator></item><item><title>RE: how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>Are all the columns in common between the 50 stored procedures?    Even if you defined a temp table with enough columns to handle any of the stored procedures, you would still have to define which columns are going to be populated by the output of the stored procedures.   For examplecreate table #temp (many many columns)insert into #temp  (colA,colB,colC)exec stproc1insert into #temp (colA,colC,colD,colE)exec stproc2insert into #temp (colA,colB,col,C,colD,colE,colF,colG...)exec stproc99There just isn't an "automatic" way to avoid all this with stored procedures.   </description><pubDate>Mon, 03 Aug 2009 19:32:29 GMT</pubDate><dc:creator>The Dixie Flatline</dc:creator></item><item><title>RE: how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>Well - temp tables are certainly one way... but they're not the ONLY way.  depending on what you want to do with them, you can set up a "self-linked server" and then use them a bit like table-valued functions and access their output as a table variable.As in - something like[code="sql"]Select * from openquery(MyLocalServer, 'exec mydbo.dbo.myStoredProc @Param=1')[/code]</description><pubDate>Mon, 03 Aug 2009 16:01:45 GMT</pubDate><dc:creator>Matt Miller (#4)</dc:creator></item><item><title>RE: how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>Sorry to tell you this, but I think you are in for creating a bunch of temp tables.  You can't execute a stored procedure from within a function or a select statement so that rules out being able to use the SELECT...INTO syntax and other than that the table that you are inserting into must already exist.However, if the stored procs don't have any parameters, why don't you define views and use those?  A procedure with no parameters and that simply returns a result set is pretty much a view...</description><pubDate>Mon, 03 Aug 2009 15:07:17 GMT</pubDate><dc:creator>DCPeterson</dc:creator></item><item><title>how to get output from stored procedures</title><link>http://www.sqlservercentral.com/Forums/Topic764373-338-1.aspx</link><description>I need to get the output from the stored procedures (50 of them), and insert into a temp table at each execution of a stored procedure. Is there a way for me to do this WITHOUT having to pre-define the temp table (because the columns are all different for each stored procedureoutput, otherwise I would have to create 50 temp tables, which I prefer not having to do it like that). I am not allowed to change the stored procedures. The stored procedures do not have any parameters, so I cannot use OUTPUT. if I have to create that many temp tables, then I guess I would have to, but I just wanted to make sure there is no other better option.  any help/advice would be greatly appreciated.</description><pubDate>Mon, 03 Aug 2009 14:13:52 GMT</pubDate><dc:creator>sqlblue</dc:creator></item></channel></rss>