Re: putting the results of a stored procedure into a cursor... is it possible?
hkvats_1999_at_yahoo.com
Date: 06/25/04
- Next message: sqlguy: "Rights to the tables disappear from the role."
- Previous message: hkvats_1999_at_yahoo.com: "Re: how to create stored proc to read in flat file, parse it, and create records?"
- In reply to: Jeigh: "Re: putting the results of a stored procedure into a cursor... is it possible?"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Jun 2004 02:57:37 -0700
Instead of Stored Procedure you need careate User-Defined-Function,
which returns table type.... after that.... you need to create cursor
in following way......
declare GetData cursor for
SELECT * FROM dbo.GetCustomers()
Regards
Hari Sharma....
Sr. Consultant...
Database
"Jigh" <folkens.jason@acd.net> wrote in message news:<JtSdnRHydu7tvyDdRVn-iQ@giganews.com>...
> I suppose I can do that... I didn't realize that sp_helptext worked with
> system stored procedures.
>
> Thanks for pointing that out bb_43 :-)
>
>
> <bb_43@hotmail.com> wrote in message
> news:l58vc.77443$Qh7.49237@newssvr25.news.prodigy.com...
> > In article <7-6dnfhEfpeCbCHdRVn-hA@giganews.com>, "Jeigh"
> <folkens.jason@acd.net> wrote:
> > >I wanna do something like this:
> > >
> > >declare GetData cursor for EXEC sp_helpindex 'customers'
> > >open GetData
> > >fetch from GetData into @index_name
> > >while @@fetch_status == 0
> > >begin
> > > -- rebuild the index and run dbcc showcontig on it
> > > fetch from GetData into @Index_name
> > >end
> > >
> > >
> > >
> > >This errors because Im trying to store the results of a SP into a
> cursor...
> > >does anyone know how I can get around this limitation? I'veb even tried
> > >using OPENQUERY using the local server as a linked server and it
> complains
> > >about something else... "the object has no columns"
> > >
> >
> > Why not simply deconstruct the sp and take the parts you want?
- Next message: sqlguy: "Rights to the tables disappear from the role."
- Previous message: hkvats_1999_at_yahoo.com: "Re: how to create stored proc to read in flat file, parse it, and create records?"
- In reply to: Jeigh: "Re: putting the results of a stored procedure into a cursor... is it possible?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|