yoursyun
Procedure 에서 Table Parameter 사용 본문
CREATE TYPE T_CUST_LIST
AS TABLE
(
CUST_CODE VARCHAR(50)
);
GO
CREATE PROCEDURE UP_TVP_TEST
@TVP T_CUST_LIST READONLY
AS
SET NOCOUNT ON
SELECT M.CD_COMPANY, M.LN_PARTNER
FROM @TVP C
INNER JOIN M_TABLE M ON C.CUST_CODE = M.CD_PARTNER
GO
DECLARE @TVP AS T_CUST_LIST;
INSERT INTO @TVP (CUST_CODE)
SELECT TOP 100 CUST_CODES
FROM M_TABLE
GO
EXEC UP_TVP_TEST @TVP;
반응형