IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_CHECKINGPAYENTRY') 
 CREATE TABLE T_ER_CHECKINGPAYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHECKINGBILLID BIGINT DEFAULT 0 NOT NULL,
FENTRYPAYAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL,
FDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


EXEC P_ALTERPK 'PK_T_ER_CHECKINGPAYENTRY', 'T_ER_CHECKINGPAYENTRY', 'FENTRYID', '1';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ER_CHECKINGPAYENTRY_ID') CREATE INDEX IDX_ER_CHECKINGPAYENTRY_ID ON T_ER_CHECKINGPAYENTRY ( FID );


