CREATE TYPE dbo.itemList
AS TABLE
(
item_cd varchar(50)
);
GO
create function dbo.fnc_test(@P_TBL dbo.itemList READONLY)
returns VARCHAR(MAX)
as
begin
declare @R_VALUE VARCHAR(MAX);
SELECT @R_VALUE = max(item_cd)
FROM @P_TBL;
return @R_VALUE;
end;
go
BEGIN
DECLARE @P_TBL AS dbo.itemList
insert into @P_TBL
select top 100
item_cd
from esmmtgl;
select dbo.fnc_test(@P_TBL);
END;
사용자 정의 테이블을 파라메터로 하는 함수만들기
|
2018.01.12 02:00:59
|
2018.01.12 02:00:59
|
370
|
Aiden
Total of Attached file
0.00 Bytes of 0 files
2020.08.20
2019.02.21
2018.06.11
2018.05.31
2018.01.12
2018.01.03
2017.10.23
2012.10.29
2012.10.19
2012.09.04