[dba-SQLServer] Returning a dataset

Paul Nielsen pauln at sqlserverbible.com
Tue Mar 25 11:00:55 CDT 2008

Hi John,

Here's a chapter on sprocs. It's not the greatest chapter, but the section
on return data scope is useful.


-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Monday, March 24, 2008 4:17 PM
To: 'Discussion concerning MS SQL Server'
Subject: [dba-SQLServer] Returning a dataset

A stored procedure can return a data set correct?  Is that data set

I need to run a stored procedure, where I pass in the Value for the TOP N
(the N part) and then build up a SQL statement and execute that inside of
the sp.  That sp needs to return the data set to another SP, and that SP has
to update a field in the data set returned by the first sp.

Is this possible?  

ATM I have a view called TopN, which returns a date field.  I have a query
that updates that date field to today's date.  The problem is that the TopN
view is hard coded with a number (30000 for today's order) but that value
could be any number.  So I need to turn the view into a SP where I can pass
in the number of records to update and then pass the set up date fields back
to an update SP to do the update.

John W. Colby
Colby Consulting

dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com

__________ NOD32 2968 (20080324) Information __________

This message was checked by NOD32 antivirus system.

More information about the dba-SQLServer mailing list