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
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