SQL Server 2005 Table-Valued Function Problem
Posted on 2007-11-26
I have created the below function to get a full description for a field from a table in my database. However, when using my function, I get an error message that says:
"Cannot find either collumn "dbo" or the user-defined function or aggregate "dbo.getCode", or the name is ambiguous."
I don't know a whole lot about these functions, so I may be doing something wrong, but below is what I am executing in my query:
SELECT dbo.getCode(grade, 'grades') AS Code
And this is my function:
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
ALTER FUNCTION [dbo].[getCode]
SELECT tbl_element_desc FROM codes_table WHERE tbl_type_code = '@CodeType' AND tbl_element = '@Code'
Thanks in advance for the help!