/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_CAS_CLAIMBILL', 'T_CAS_CLAIMBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CLAIMBILL_BO') CREATE INDEX IDX_CAS_CLAIMBILL_BO ON T_CAS_CLAIMBILL ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CLAIMBILL_CO') CREATE INDEX IDX_CAS_CLAIMBILL_CO ON T_CAS_CLAIMBILL ( FCLAIMNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CLAIMBILL_CB') CREATE UNIQUE  CLUSTERED INDEX IDX_CAS_CLAIMBILL_CB ON T_CAS_CLAIMBILL ( FBILLSTATUS ,FCLAIMNO );


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMBILL_L', 'T_CAS_CLAIMBILL_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CBL_FID') CREATE UNIQUE  CLUSTERED INDEX IDX_CAS_CBL_FID ON T_CAS_CLAIMBILL_L ( FID );


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMDETAILENTRY', 'T_CAS_CLAIMDETAILENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMNOTICEBILL', 'T_CAS_CLAIMNOTICEBILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CLAIMNOTICEBILL_BO') CREATE INDEX IDX_CAS_CLAIMNOTICEBILL_BO ON T_CAS_CLAIMNOTICEBILL ( FBILLNO );

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


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMNOTICEBILL_E', 'T_CAS_CLAIMNOTICEBILL_E', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMNOTICEBILL_L', 'T_CAS_CLAIMNOTICEBILL_L', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CAS_CNBL_FID') CREATE UNIQUE  CLUSTERED INDEX IDX_CAS_CNBL_FID ON T_CAS_CLAIMNOTICEBILL_L ( FID );


 EXEC P_ALTERPK 'PK_T_CAS_CLAIMTYPE_E', 'T_CAS_CLAIMTYPE_E', 'FENTRYID', '1';

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



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