/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_constraint.sql **/
  EXEC P_ALTERPK 'PK_T_BD_INSPECT_CFG', 'T_BD_INSPECT_CFG', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INSPCT_FCREATETIME') CREATE INDEX IDX_BD_INSPCT_FCREATETIME ON T_BD_INSPECT_CFG ( FCREATETIME );

  EXEC P_ALTERPK 'PK_T_BD_INSPECT_CFG_L', 'T_BD_INSPECT_CFG_L', 'FPKID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INSPCTL_FNAME') CREATE INDEX IDX_BD_INSPCTL_FNAME ON T_BD_INSPECT_CFG_L ( FNAME );

 EXEC P_ALTERPK 'PK_T_BD_INSPECT_QCP', 'T_BD_INSPECT_QCP', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INSPCT_FSEQ') CREATE INDEX IDX_BD_INSPCT_FSEQ ON T_BD_INSPECT_QCP ( FSEQ );
 
  EXEC P_ALTERPK 'PK_T_BD_INSPECT_FNS', 'T_BD_INSPECT_FNS', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_FNS_FSEQ') CREATE INDEX IDX_BD_FNS_FSEQ ON T_BD_INSPECT_FNS ( FSEQ );

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