dbTalk Databases Forums  

Problems calling stored procedure within another stored procedure.

microsoft.public.sqlserver.mseq microsoft.public.sqlserver.mseq


Discuss Problems calling stored procedure within another stored procedure. in the microsoft.public.sqlserver.mseq forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Angela Anderson
 
Posts: n/a

Default Problems calling stored procedure within another stored procedure. - 07-28-2003 , 10:47 AM






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


Reply With Quote
  #2  
Old   
Ray Higdon
 
Posts: n/a

Default Problems calling stored procedure within another stored procedure. - 07-28-2003 , 11:55 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

Quote:
-----Original Message-----
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

.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.