IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_BILLTRANFERENTRY_L')
 CREATE TABLE T_MRP_BILLTRANFERENTRY_L (
FPKID NVARCHAR(18) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESTFIELDNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FSOURCEFIELDNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);

 EXEC P_ALTERPK 'PK_MRP_BILLTRANFERENTRY_L', 'T_MRP_BILLTRANFERENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MRP_BILLTRANFERENTRY_L') CREATE INDEX IDX_MRP_BILLTRANFERENTRY_L ON T_MRP_BILLTRANFERENTRY_L (FENTRYID ,FLOCALEID );
