/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_HDM_REGAGREEDEXP', 'T_HDM_REGAGREEDEXP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_REGAGREEDEXP' AND KSQL_INDNAME = 'IDX_HDM_REGEXP_FTRIALPERIOD') CREATE INDEX IDX_HDM_REGEXP_FTRIALPERIOD ON T_HDM_REGAGREEDEXP ( FERMAINFILEID );


 EXEC P_ALTERPK 'PK_HDM_REGNEARPREDATE', 'T_HDM_REGNEARPREDATE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_REGNEARPREDATE' AND KSQL_INDNAME = 'IDX_HDM_REGDATE_FERMAINFILEID') CREATE INDEX IDX_HDM_REGDATE_FERMAINFILEID ON T_HDM_REGNEARPREDATE ( FERMAINFILEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_REGNEARPREDATE' AND KSQL_INDNAME = 'IDX_HDM_REGDATE_RULE') CREATE INDEX IDX_HDM_REGDATE_RULE ON T_HDM_REGNEARPREDATE ( FORGID ,FAFFILIATEADMINORGID ,FEMPGROUPID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HDM_constraint.sql **/
