[dba-SQLServer] Returning a dataset

jwcolby jwcolby at colbyconsulting.com
Mon Mar 24 17:17:17 CDT 2008


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

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
www.ColbyConsulting.com 




More information about the dba-SQLServer mailing list