USP with multiple results sets

Hi guys.

I have a Stored Procedure that returns two results sets.

how do I get the 2nd results set into a temp table.

If it only produces one results set I should be able to do the following.

Create ##temptable (table definintion...)
insert into ##temptalble
 exec @err = usp_my_stored_proc @parm_1,@param2 ...

but I can't find anywhere on the net how to tell it which results set to
process into the temp table 

If anyone knows..

Obiron
0
obiron
1/19/2010 6:24:20 PM
sqlserver.server 1327 articles. 0 followers. Follow

2 Replies
928 Views

Similar Articles

[PageSpeed] 45

Oh yeah, forgot to say - OPENROWSET is not an option.  It is not configured
on our server and I am struggling to get the DBAs to turn it on..


obiron wrote:
>Hi guys.
>
>I have a Stored Procedure that returns two results sets.
>
>how do I get the 2nd results set into a temp table.
>
>If it only produces one results set I should be able to do the following.
>
>Create ##temptable (table definintion...)
>insert into ##temptalble
> exec @err = usp_my_stored_proc @parm_1,@param2 ...
>
>but I can't find anywhere on the net how to tell it which results set to
>process into the temp table 
>
>If anyone knows..
>
>Obiron
0
obiron
1/19/2010 6:24:40 PM
You cannot to this in straight T-SQL. Normally it is best done client side. One alternative is to use CLR, see this 
example by Erland Sommarskog:
http://www.sommarskog.se/share_data.html#CLR

-- 
Plamen Ratchev
http://www.SQLStudio.com
0
Plamen
1/19/2010 6:35:07 PM
Reply:

Similar Artilces:

how to seperate data from 1 cell into multiple cells?
How can I take a cell that contains a name and title and seperate it into 3 cells? e.g. 1 cell with John Smith, M.D. into 3 cells? Thanks Lloyd Select the cell, use Data/Text to Columns, click Delimited, then select Space and Finish. "Lloyd" <info@atlanticvoice> wrote in message news:<8ebd01c3ea12$04e08600$a001280a@phx.gbl>... > How can I take a cell that contains a name and title and > seperate it into 3 cells? > > e.g. 1 cell with John Smith, M.D. into 3 cells? > > Thanks > > Lloyd I gave this to my class... on the menubar, Data: Tex...

Business Portal should allow me to access different dynamics.set
I use GP to manage several different companies. Each company had different check formats. It is fairly simple to set up different report.dic files for different companies if you are using terminal services directly or are using GP from your desktop, however, if you are running thru Business Portal you are only allowed to point to one dynamics.set file. It would be great if you could set up BP so that it would point to different dynamics.set files for differnt companies. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most ...

Cen an Excel file be set up to no longer open after a certain date????
Any help would be very much appreciated. Is there a way to set up an excel file to not open after a certain date or after a certain amount of time? Thank you in advance!! Lou Blah wrote: > Any help would be very much appreciated. > > Is there a way to set up an excel file to not open after a certain > date or after a certain amount of time? > > Thank you in advance!! > > Lou This could be done with a VBA Macro but you would have to take security measures to keep the user from tampering with the code. Maybe even incoporate code that deletes all of the data includ...

How to configure multiple bank logins for same bank
I would like to setup Money 2008 to download account information from Bank of America using two different web login id's. It seems to me that once I pick a bank in money I can only associate one login info with that bank. Is it possible to have multiple accounts from the same bank? Regards P. In microsoft.public.money, Pieter wrote: >I would like to setup Money 2008 to download account information from Bank >of America using two different web login id's. > >It seems to me that once I pick a bank in money I can only associate one >login info with that bank. >...

Assigning Campaign Activities to multiple users based on Criteria
Hi, Is there any way to have the assignment of campaign activities done on the basis of certain criteria? (i.e.; on postal code of the account, assigned to TM working on the corresponding region). If not: is there any way to have the distribution of multiple activities in a queue done on the basis of certain criteria? (i.e.; see above example). Thank you, Steven Hi Steven, Sounds like that you can leverage the CRM 4.0 Workflow to accomplish your task. Please look into workflow and if you have any questions, feel free to post it here. Darren Liu, Microsoft CRM MVP Crowe http://www.crow...

import Exchange 2003 information stores into newly set up Exchange 2007
Exchange 2007 set up and running beautifully. But I had a previous Exchange 2003 that was running as part of SBS on a different domain that I would like to import private and public information stores into the new Exchange 2007 environment. I have the 2003 information stores copied to a backup directory on the new Exchange server. Any ideas? I thought there might be some command line utility for such. Thanks very much! Don On Sun, 17 Dec 2006 13:34:59 -0600, "dbj" <dbj@midsouth.rr.com> wrote: >Exchange 2007 set up and running beautifully. But I had a previou...

Best way to set up Query to get a percentage
I have a "classified" field that is a yes/no check box to determine if a supplier has been classified or not. I need to get the sum of suppliers that are and are not classified and then I need to get a percentage of suppliers who is and who isn't classified from the total suppliers. I also want to be able to chart this without exporting to Excel. Any ideas on the best way to set this up? Marc - You can do that in a query. Change the fields and table names to be yours: SELECT Sum(IIf([Classifed],1,0)) AS Yes_Count, Count(SupplierID) AS Total_Count, Sum(IIf([C...

Unable to set the XValues Property
I am getting a run -time error 1004 stating it is unable to set the XValues Property of the Series Class. I don't know why!!! I did some changes to the old code which was running fine but this code is annoying me . Can anybody help plz Sub SelectCapacity() Sheets("Numerical Integration").ChartObjects("ChartNumInteg").Activate ActiveChart.PlotArea.Select ActiveChart.ChartType = xlXYScatterSmoothNoMarkers Select Case CapacityCombo.Value Case "Exponential" With ActiveChart .SeriesCollection(1).XValues = "=AnalysisPageNI!R4...

Setting X Axis with a serie
Hi, After looking to dozens of web pages, I still didn't find a simple answer from a frequent question. How is it possible to set the X Axis to display a serie with Vb .net ? I have no problem with the setsourcedata method, but I can't find the way to do the same with the X axis, let's say something like "set x axis value"=range("A1:A100") Thanks for the help. ...

OUTLOOK (2007) won't send to multiple addresses
Vista. I'm trying to "reply all" to a group of about 40 addresses. The message gets stuck in the outbox. If I "reply all" but substitute a single email address, it goes with no problem. Is there some kind of limit, restriction or otherwise that affects messages? Thank you. The limit is set by your ISP/Mail Server. Contact them to find out what your limit is. "its_my_dime" <its_my_dime@yahoo.com> wrote in message news:urv87qDcJHA.4124@TK2MSFTNGP06.phx.gbl... : Vista. : : I'm trying to "reply all" to a group of about 40 address...

Error after setting default pricelist
Hi, In the opportunity form, i added javascript code in order to input default the pricelist value automatically. When loading the form, the default pricelist was successfully added. However i could not add the new opportunity product. The error was " you have changed the pricelist for the opportunity. Please save the opportunity form before attempting to add the product." I have save the form several times but still cannot add the product. What's wrong? Carrie ...

How to Restore Outlook's Previous Settings
I was having a problem with Excel 2002 not being able to read any .xls file. After trying several other things to no avail, I reset all the settings in my Office XP (including Outlook) to the default settings. Now I'd like to restore my previous Outlook settings. How do I do this? Thanks in advance. Did you save backups of everything prior to resetting everything to default settings? ...

Display a list of unique values from a column with multiple instances
Hi- I have a list in a column (column A) that has many duplicate values. I am looking to create a list of the unique values from column A into another column (column F). I just want to display the values from col A into col F without deleting any values from col A. From there I am planning on doing a countif based on the value in col F to see how many duplicates I have. I want to do this dynamically because anyone can add a new value in col A but I don't want to have to manually compare unique values in col A against col F to do the counts. Col A contains ID numbers that can be repeat...

Using multiple SMTP email addresses
How can I determine which email address an email was sent to (short of manually looking at the headers of the email)? I have multiple SMTP addresses associated with my AD account, and I want to set up rules in Outlook based on which address an email was sent to, but all Outlook seems to see is my default smtp address. This behavior is "by design". When Exchange 200x receives a message via SMTP is resolves it to an object in AD and rewrites the To: address to that of the primary SMTP address of the object that the message is destined for. "Josh Rolfe" <some...

Can someone PLEASE let me know how to change my desktop settings in Vista?
I have a Nikon D3000 which takes shots that are wider in ratio to their height than my monitor is. When I was running XP, it automatically displayed the wallpaper as widescreen, with bars at the top and bottom. My Vista set up doesn't do that automatically and I don't know how to make it happen. I'm no expert, but I've managed to do a little more in terms of fixing things than a lot of comp owners who aren't programmers have, but this baffles me, despite the fact there are probably teenagers in this city who use a machine 20 minutes a week who would know. And th...

Purging multiple mailboxes #2
I have tryed that but once I have more than one bx selected the only option I get is "help" Any other ideas??? >-----Original Message----- >Hold down the Ctrl key and select the mailboxes you want to purge. > > > > >On Wed, 1 Sep 2004 03:07:47 -0700, "Stano" ><pstanton@mackillopsh.vic.edu.au> wrote: > >>Using exchange 2003. >>Does anyone knoe how to purge multiple mailboxes, I can >>only do it one at a time so far... >> >>Thanks > >. > You could change the setting as to how long you hold mailbox...

import export settings
I bought a new computer and I'd like to set outlock just as on my old computer. My question is, do I have to do it everything manually or there's a way I can export setting like pop account, e-mails, calendar, contacts, tasks, etc (all at once) into a file and then import the file in the new computer. I used to have Incredimail as e-mail client and I remember I could do that. I could export into a file absolutely all my settings and then I would import it in the new computer. Both computer have outlock professional running on windows XP Thanks! "Lucorium" <Lucori...

Multiple IF Statements #2
Hi guys, Another problem for you. I am doing some work and requires multiple IF statements to be used. I know how to write a statement if all cells have a common factor, for example: Code:-------------------------------------------------------------------------------- =IF(OR(E11="Error",E15="Error",E23="Error",E29="Error",E44="Error",E48="Error"),"Check N/a Boxes",(D57/A57)) -------------------------------------------------------------------------------- But how do I write it to display different results. For example, ...

Is there a way to use a multiple column array in SUMPRODUCT?
I am attempting to use SUMPRODUCT to pull values froma multiple column spreadsheet and add them together. I am able to get the SUMPRODUCT to work if I am only looking for values in one column, but as soon as I select all columns, the function no longer works. example: column A holds accounts, column B holds subaccounts, columns D - F (possibility of over 100 columns) hold companies I am looking for all values to be added together that hold values for both column A and column B =SUMPRODUCT(--(A2:A61=A44),--(B2:B61=B44)--(F2:F61)) works for just column F, but when I try ...

Import Folder Search Results in a spreadsheet?
Anyone know if it is possible to "import" the results of a files and folders search into a sporeadsheet? Not the actual files and folders, or course, but the filename text, location text and date... Mark B, Maybe this ... http://makeashorterlink.com/?Y49E21ECA Jim Cone San Francisco, USA "Mark B" <MarkB@discussions.microsoft.com> wrote in message news:498B7867-9CC4-4838-9DD0-6E5845787E17@microsoft.com... > Anyone know if it is possible to "import" the results of a files and folders > search into a sporeadsheet? > > Not the actual fil...

Export parameterized query results to Excel
Greetings all. I have a main form/subform set up, where the source object of the subform is a parameterized stored procedure. There are three parameters which are supplied by three combo boxes on the main form. The user clicks a command button, and a data sheet with the results populates the subform. How can I export the results to an Excel file? I've read through many posts here, but I can't seem to find anything with my specific set up. Thank you. Greg -- Message posted via http://www.accessmonster.com ...

Excel: Can't save changes to print number of copies setting
I inherited an Excel workbook that has the number of copies to print set to 10. I change it to 1, then save the file, but it always reverts back to ten. ...

Removing formulas and keeping results
I am currently using MATCH formulas to pull certain data from SHEET1 and place the appropriate data in various cells in SHEET2. My problem is that now I want to keep SHEET2 as it is but also to Save As SHEET2 to a different location and for it to stop updating the information in it when I make changes to SHEET1. I basically want SHEET2 to be an independant spreadsheet after I pull the appropriate information from SHEET1. So is there a way to remove the many formulas that are in the cells of SHEET2 and just keep the text of the results in those cells? Is this possible? --- Message post...

Query with Multiple Criteria 01-21-10
Hi, I have a form called frmEmailScheduleToClientMenu and on that form i have the following unbound combo boxes: txtClient (Row Source: SELECT [tblClientContact].[autClientID], [tblClientContact].[txtCompany] FROM tblClientContact ORDER BY [txtCompany];) txtLevel (Row Source: SELECT [suptblLevel].[autLevelID], [suptblLevel].[txtLevelAbbreviation] FROM suptblLevel ORDER BY [txtLevelAbbreviation]; ) txtFacilitator (Row Source: SELECT [tblFacilitator].[autFacilitatorID], [tblFacilitator].[txtName] FROM tblFacilitator ORDER BY [txtName]; txtCourse (Row Source: SELECT [...

Outlook 2000, multiple inboxes
When I load up my Outlook 2000, it starts up to the inbox which is fine. If I click send/receive, it opens up another inbox screen with the same emails as in the first inbox. Same thing when clicking send/receive even more times. This has been happening for about 5 days. Any ideas on what is causing this? On Tue, 24 May 2005 02:55:06 GMT, maryjersen55@home.net (Mary J.) wrote: >When I load up my Outlook 2000, it starts up to the inbox which is >fine. If I click send/receive, it opens up another inbox screen with >the same emails as in the first inbox. Same thing when cl...