首先创函数:
CREATE FUNCTION f_WK_GetEnum
(
-- Add the parameters for the function here
@enumtype nvarchar(200),
@evalue int
)
RETURNS nvarchar(200)
AS
BEGIN
-- Declare the return variable here
DECLARE @rtnvalue nvarchar(200)
-- Add the T-SQL statements to compute the return value here
select @rtnvalue=max(subb.Name) from UBF_Sys_ExtEnumValue suba join UBF_Sys_ExtEnumValue_Trl subb on suba.id=subb.ID join UBF_Sys_ExtEnumType subc on suba.ExtEnumType=subc.ID where subc.Code=@enumtype and suba.EValue=@evalue
--
CREATE FUNCTION f_WK_GetEnum
(
-- Add the parameters for the function here
@enumtype nvarchar(200),
@evalue int
)
RETURNS nvarchar(200)
AS
BEGIN
-- Declare the return variable here
DECLARE @rtnvalue nvarchar(200)
-- Add the T-SQL statements to compute the return value here
select @rtnvalue=max(subb.Name) from UBF_Sys_ExtEnumValue suba join UBF_Sys_ExtEnumValue_Trl subb on suba.id=subb.ID join UBF_Sys_ExtEnumType subc on suba.ExtEnumType=subc.ID where subc.Code=@enumtype and suba.EValue=@evalue
--