/**Begin D:\pdm\PDM_UPGRADE\pdm_new\BDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_BDM_BILL_ARCHIVE_LOG', 'T_BDM_BILL_ARCHIVE_LOG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_LOG1') CREATE  CLUSTERED INDEX IDX_BDM_BILL_ARCHIVE_LOG1 ON T_BDM_BILL_ARCHIVE_LOG ( FSNUMBER ,FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_LOG2') CREATE INDEX IDX_BDM_BILL_ARCHIVE_LOG2 ON T_BDM_BILL_ARCHIVE_LOG ( FPK );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_LOG3') CREATE INDEX IDX_BDM_BILL_ARCHIVE_LOG3 ON T_BDM_BILL_ARCHIVE_LOG ( FBATCH );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_LOG4') CREATE INDEX IDX_BDM_BILL_ARCHIVE_LOG4 ON T_BDM_BILL_ARCHIVE_LOG ( FCREATEDATEFIELD );


 EXEC P_ALTERPK 'PK_BDM_BILL_ARCHIVE_MONTH', 'T_BDM_BILL_ARCHIVE_MONTH', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_MONTH') CREATE  CLUSTERED INDEX IDX_BDM_BILL_ARCHIVE_MONTH ON T_BDM_BILL_ARCHIVE_MONTH ( FTENTITY ,FDATA_MONTH );


 EXEC P_ALTERPK 'PK_BDM_BILL_ARCHIVE_CONFIG', 'T_BDM_BILL_ARCHIVE_CONFIG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_CONFIG1') CREATE UNIQUE  CLUSTERED INDEX IDX_BDM_BILL_ARCHIVE_CONFIG1 ON T_BDM_BILL_ARCHIVE_CONFIG ( FSENTITY );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_BILL_ARCHIVE_CONFIG2') CREATE UNIQUE INDEX IDX_BDM_BILL_ARCHIVE_CONFIG2 ON T_BDM_BILL_ARCHIVE_CONFIG ( FTENTITY );



/**End D:\pdm\PDM_UPGRADE\pdm_new\BDM_constraint.sql **/
