I have this function get_department
. Inside the function there is a function call for get_po_amount
.
The get_po_amount
function doesn't exist anymore, so when I try to create the Main function get_Department
, I get the error "invalid object name get_po_amount".
Is there any way that I could create the function by not creating the function inside.
I have the same issue with views also. Calling a view inside another view.
I created these functions just to show an example, I need to do this on a large database.
CREATE FUNCTION [dbo].[GET_DEPARTEMNET]
(
@DEPTNO NVARCHAR(100)
)
RETURNS TABLE
AS
RETURN
(
SELECT * FROM [dbo].[dept] WHERE DEPTNO=(SELECT [dbo].[GET_PO_AMOUNT](@DEPTNO)))
GO