본문 바로가기
MS-SQL

스칼라 펑션(scalar function)

by 캡틴노랑이 2015. 7. 28.
반응형

스칼라 펑션

ALTER FUNCTION [dbo].[UF_GetCodeMst] (@Code int)
RETURNS varchar(50)
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @gCodeName varchar(50)
SELECT @gCodeName = Codename
FROM CodeMst
WHERE Code = @Code
RETURN(@gCodeName)
END;

 

반응형

댓글