Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2006, 05:05 AM
Registered User
 
Join Date: Jan 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default send multiply query one stored procedures

hi,
i want to run two or more query single stored procedures. how can i do this


 
Old April 20th, 2006, 09:38 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Can you provide a bit more information? You can run multiple queries in a stored procedure but a stored procedure can return only a single result set.

 
Old April 20th, 2006, 10:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by SQLScott
 You can run multiple queries in a stored procedure but a stored procedure can return only a single result set.
This is not true.

A stored procedure can certainly return multiple resultsets. Execute such an SP in Query Analyzer and you'll see each resultset listed one after the other.

As for client consumer code, how those those resultsets are handled depends on the mechanisms and data providers chosen. For example, in .NET terms, if a DataReader is used then the DataReader.NextResultSet method will advance to each resultset in turn. Or, populating a DataSet from the stored procedure via a DataAdapter will create one DataTable in the DataSet for each resultset returned.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old April 20th, 2006, 12:34 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Yeah, brain fart on my part. My apologies for the misinformation.






Similar Threads
Thread Thread Starter Forum Replies Last Post
stored procedures thillaiarasu ASP.NET 2.0 Basics 2 May 3rd, 2007 07:55 AM
Stored Procedures itHighway SQL Server 2000 3 November 23rd, 2005 10:08 AM
Stored Procedures seanmayhew BOOK: ASP.NET Website Programming Problem-Design-Solution 4 June 10th, 2004 10:06 AM
Stored Procedures stu9820 Access 3 February 8th, 2004 01:13 PM
Using Stored Procedures lintacious Classic ASP Basics 1 August 12th, 2003 04:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.