/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SEC_USERCONTACT', 'T_SEC_USERCONTACT', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACT') CREATE INDEX IDX_T_SEC_USERCONTACT ON T_SEC_USERCONTACT ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACT_TYPE') CREATE INDEX IDX_T_SEC_USERCONTACT_TYPE ON T_SEC_USERCONTACT ( FCONTACTTYPEID );


 EXEC P_ALTERPK 'PK_T_SEC_USERCONTACT_H', 'T_SEC_USERCONTACT_H', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACT_H') CREATE INDEX IDX_T_SEC_USERCONTACT_H ON T_SEC_USERCONTACT_H ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACT_TYPE_H') CREATE INDEX IDX_T_SEC_USERCONTACT_TYPE_H ON T_SEC_USERCONTACT_H ( FCONTACTTYPEID );


 EXEC P_ALTERPK 'PK_T_SEC_USERCONTACTTYPE', 'T_SEC_USERCONTACTTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACTTYPE_NUM') CREATE INDEX IDX_T_SEC_USERCONTACTTYPE_NUM ON T_SEC_USERCONTACTTYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_SEC_USERCONTACTTYPE_L', 'T_SEC_USERCONTACTTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SEC_USERCONTACTTYPE_L') CREATE INDEX IDX_T_SEC_USERCONTACTTYPE_L ON T_SEC_USERCONTACTTYPE_L ( FID ,FLOCALEID );



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