Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 3rd, 2006, 06:34 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return 2 Recordsets from 1 Stored Proc

Hi there,
I am trying to run the following stored proc from asp.net 2.0 and have two record sets returned.

How do i go about doing this? Is it possible?

If I execute the SP on SqlServer it returns 2 recordsets as i want... Just unsure about asp.net. I realize I could use 2 stored procs to achieve the same thing but want to know how to do it with one.

thanks :)

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

ALTER PROCEDURE [dbo].[spgGetCreditorControl]
    (
    @CreditorID int,
    @StartDate DateTime,
    @EndDate DateTime
    )

AS
BEGIN
    SET NOCOUNT ON;

    SELECT PurchaseInvSummary.Date AS PurchaseDate,
           PurchaseInvSummary.Reference AS PurchaseRef,
               PurchaseInvSummary.Gross AS PurchaseGross,
               Customer.Name

    FROM PurchaseInvSummary INNER JOIN
           Customer ON (PurchaseInvSummary.CreditorID = Customer.ID)
    WHERE (PurchaseInvSummary.CreditorID = @CreditorID) AND
           (Date >= @StartDate) AND
           (Date <= @EndDate)

    SELECT [Transaction].Date AS TransactionDate,
           [Transaction].Narrative AS TransactionNarrative,
           [Transaction].Amount AS TransactionAmount

    FROM [Transaction] INNER JOIN
           AccountType ON [Transaction].AccountID = AccountType.AccountID
    WHERE AccountType.CustomerID = @CreditorID AND
           [Transaction].Date >= @StartDate AND
           [Transaction].Date <= @EndDate

END

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling an insert stored proc from a select stored dzitam SQL Language 10 April 2nd, 2007 01:39 PM
Storing return value of a Stored Proc in a Session mahajanvit ASP.NET 2.0 Basics 0 November 2nd, 2006 10:16 AM
problem with a stored proc trying to return blobs Phrozt SQL Server 2000 2 May 12th, 2006 10:36 AM
Return output variable to VB from SQL stored proc busterbunny BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 27th, 2006 10:24 PM
Using recordsets in Stored Procedures MaxGay SQL Server 2000 3 February 25th, 2005 11:38 AM



All times are GMT -4. The time now is 05:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.