all groups > sql server mseq > july 2003 >
You're in the

sql server mseq

group:

Problems calling stored procedure within another stored procedure.


Problems calling stored procedure within another stored procedure. Angela Anderson
7/28/2003 8:47:06 AM
sql server mseq:
The problem is I have a table called Products and a table
called Order_Items. Customers can place many orders so
what I want to do is for one particualar order show all
Products but link to Order_Items on a left join so that
for ordered. The problem is when I filter out for the
Order I want, it only shows me items ordered and not all
Products. I have tried to create the filtering in a
separate stored procedure and left join this stored
procedure with the products table but when I run this
procedure using the Query analyser I get the message that
it can’t find the stored procedure which is used to do the
filtering.

Does anyone know if you can call a stored procedure within
a stored procedure? Or is there another way of doing
this? I am only new to SQL and come from an Access
background where you can call up a query within another
query.

Any help much appreciated.

Angela
Problems calling stored procedure within another stored procedure. Ray Higdon
7/28/2003 9:55:35 AM
You can call a stored proc from within a stored proc but
not in a select statment or join. You can join a user
defined function in your join statement. I'm not clear on
what it is you are trying to do, you want to pass an order
id parameter and get back everything ordered as well as
all possible products?


Ray Higdon MCSE, MCDBA, CCNA

[quoted text, click to view]
AddThis Social Bookmark Button