Calling a Stored Procedure from a Stored Procedure 
Author Message
 Calling a Stored Procedure from a Stored Procedure
Hi!

Can I directly use the result of a SP into another SP to make a calcul (as a
function)?

Ex:
*******


result of pspQty (a SP) directly in the calcul.
FROM Products

*******

Is it possible to do something like that? How?

TIA

Yannick



Sat, 05 Jul 2003 01:27:37 GMT
 Calling a Stored Procedure from a Stored Procedure

Hi Yannick,

Yes you can,

You can return values from a SP to another SP either as a single value using
an Output Parameter (read about it in BOL)

Alternatively you can get a table of results from an SP by saying:

Create #TempTable (
  -- Definition that matches your results
)

insert #TempTable Exec mp_SP

or maybe that is

insert #TempTable (Exec mp_SP)

I can never when to use the "()".

HTH

--
-Dick Christoph

http://www1.minn.net/~dchristo


Quote:
> Hi!

> Can I directly use the result of a SP into another SP to make a calcul (as
a
> function)?

> Ex:
> *******


> result of pspQty (a SP) directly in the calcul.
> FROM Products

> *******

> Is it possible to do something like that? How?

> TIA

> Yannick



Sat, 05 Jul 2003 01:56:19 GMT
 Calling a Stored Procedure from a Stored Procedure


Quote:
> Hi!

> Can I directly use the result of a SP into another SP to make a
calcul (as a
> function)?

> Ex:
> *******


the
> result of pspQty (a SP) directly in the calcul.
> FROM Products

> *******

> Is it possible to do something like that? How?

> TIA

> Yannick

In SQL Server 2000 you can use User Defined Functions - see BOL

--
Vaughan Powell
MCDBA, MCSD, MCSE

Sent via Deja.com
http://www.deja.com/



Sat, 05 Jul 2003 02:06:23 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Call a stored procedure from another stored procedure

2. Calling a Stored Procedure from a Stored Procedure

3. Call a stored procedure in another stored procedure

4. Calling a stored procedure by another stored procedure

5. QUESTION: How can I call a Stored Procedure from another Stored Procedure

6. Calling a stored procedure within a stored procedure.

7. How do I call a stored procedure from another stored Procedure

8. Calling A Stored Procedure from another Stored Procedure

9. Calling a stored procedure from a stored procedure

10. calling a stored procedure inside a stored procedure

11. Can I call a stored procedure from a stored procedure

12. Calling Java Stored Procedure from SQL Stored Procedure


 
Powered by phpBB® Forum Software