how to Invoke User-Defined Functions That Return a Table Data Type

Posted by nectar on Stack Overflow See other posts from Stack Overflow or by nectar
Published on 2010-06-17T07:45:27Z Indexed on 2010/06/17 7:53 UTC
Read the original article Hit count: 237

Filed under:
|
|

here my code-

create function dbo.emptable()
returns Table
as
return (select id, name, salary from employee)
go

select dbo.emptable()

error: Msg 4121, Level 16, State 1, Line 1 Cannot find either column "dbo" or the user-defined function or aggregate "dbo.emptable", or the name is ambiguous.

while when I run
sp_helptext emptable it shows-

create function dbo.emptable()  
returns Table  
as  
return (select id, name, salary from employee) 

it means function exists in database then why it is giving such error?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql