/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_TRIPSYNC_DATAMAPPING_L') 
 CREATE TABLE T_ER_TRIPSYNC_DATAMAPPING_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL
);


EXEC P_ALTERPK 'PK_T_ER_TRIPSYNC_DATAMAPPING_L', 'T_ER_TRIPSYNC_DATAMAPPING_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_DATAMAPPING_L_ID') CREATE INDEX IDX_DATAMAPPING_L_ID ON T_ER_TRIPSYNC_DATAMAPPING_L ( FID ,FLOCALEID );
/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_constraint.sql **/