|
Posted by helmut woess on 10/01/06 11:28
Hello,
i want to use the result set from a stored proc in another stored proc, for
example:
create stored procedure proc1 (@x int) as
declare @tbl (y1 int, y2 int)
insert into @tbl values(@ * @x, @x * @x * @x)
select * from @tbl
GO
--
create stored procedure proc2 (@x int) as
declare @tbl (y1 int, y2 int)
while @x > 0 begin
insert into @tbl select (exec proc1 @x) <-- this is my problem
set @x = @x - 1
end
select * from @tbl
GO
--
I know i could use output parameters. But i want to know if something is
possible with SQL-Server?
thanks,
Helmut
Navigation:
[Reply to this message]
|