/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_CUSWHITESTATUS', 'T_BD_CUSWHITESTATUS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_CUSWHITESTATUS' AND KSQL_INDNAME = 'IDX_BD_CUSWHITESTATUS_ID') CREATE INDEX IDX_BD_CUSWHITESTATUS_ID ON T_BD_CUSWHITESTATUS ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_CUSWHITESTATUS' AND KSQL_INDNAME = 'IDX_BD_CUSWHITESTATUS_BASE') CREATE INDEX IDX_BD_CUSWHITESTATUS_BASE ON T_BD_CUSWHITESTATUS ( FBASEDATAID );


 EXEC P_ALTERPK 'PK_T_BD_SUPWHITESTATUS', 'T_BD_SUPWHITESTATUS', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_SUPWHITESTATUS' AND KSQL_INDNAME = 'IDX_BD_SUPWHITESTATUS_ID') CREATE INDEX IDX_BD_SUPWHITESTATUS_ID ON T_BD_SUPWHITESTATUS ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_SUPWHITESTATUS' AND KSQL_INDNAME = 'IDX_BD_SUPWHITESTATUS_BASE') CREATE INDEX IDX_BD_SUPWHITESTATUS_BASE ON T_BD_SUPWHITESTATUS ( FBASEDATAID );


 EXEC P_ALTERPK 'PK_T_BD_BILLQUERYCONTROL', 'T_BD_BILLQUERYCONTROL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BD_BILLQUERYCONTROL' AND KSQL_INDNAME = 'IDX_BD_BILLQUERYCONTROL_OBJECT') CREATE INDEX IDX_BD_BILLQUERYCONTROL_OBJECT ON T_BD_BILLQUERYCONTROL ( FOBJECT );



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