Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call SP from within a SP in SQL Server 6.5

Status
Not open for further replies.

nevets72

Programmer
Feb 6, 2002
22
US
Hi....I want to call a stored procedure from within another stored procedure, but when I go to save the stored procedure, I keep getting:

Invalid object Name 'Rpt_UnderAlloc.'

I'm able to call a View (Rpt_ActForp2), but I can't call the Stored Procedure.....why can't I do this?

Here's my code:

CREATE PROCEDURE Rpt_ActForp @date_val varchar(10) AS
BEGIN
SELECT *
FROM Rpt_UnderAlloc
Where Date <= @date_val AND
DatePart(yy,Date) = DatePart(yy,@date_val)
UNION ALL
SELECT *
FROM Rpt_ActForp2
Where Date > @date_val AND
DatePart(yy,Date) = DatePart(yy,@date_val)

END
GO
 
Is Rpt_UnderAlloc a Stored Procedure? you can't select records from a stored procedure. Yuo execute stored procedures. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains &quot;Suggestions for Getting Quick and Appropriate Answers&quot; to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top