alfardan
asked on
Function created successfully, but when called it gives an error!!
I created a function (check the code below) and it got created successfully.
Now I wanted to execute it, but it gave me the following error message:
Msg 208, Level 16, State 1, Line 2
Invalid object name 'dbo.TEST_TABLE'.
But I can see it there in my list of objects (check attachment1)
Why does it give me this error then?
Now I wanted to execute it, but it gave me the following error message:
Msg 208, Level 16, State 1, Line 2
Invalid object name 'dbo.TEST_TABLE'.
But I can see it there in my list of objects (check attachment1)
Why does it give me this error then?
CREATE FUNCTION TEST_TABLE
(
@RequestTypeID int
)
RETURNS
@MyTable TABLE
(
SystemID int,
DateOfSubmission datetime
)
AS
BEGIN
insert @MyTable
select Application_ID, Date_of_Submission from dbo.Request2_Log
return
END
function.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT * FROM [dbo].[TEST_TABLE] (<@RequestTypeID, int,>)