/**Begin D:\pdm\PDM_UPGRADE\pdm_new\SIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_SIM_BILL_LOG', 'T_SIM_BILL_LOG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_BILL_LOG') CREATE  CLUSTERED INDEX IDX_SIM_BILL_LOG ON T_SIM_BILL_LOG ( FBILLNO );

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


 EXEC P_ALTERPK 'PK_SIM_FRONT_SYSTEM_CFG', 'T_SIM_FRONT_SYSTEM_CFG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_FRONT_SYSTEM_CFG') CREATE UNIQUE  CLUSTERED INDEX IDX_SIM_FRONT_SYSTEM_CFG ON T_SIM_FRONT_SYSTEM_CFG ( FNUMBER );


 EXEC P_ALTERPK 'PK_SIM_FRONT_SYSTEM_CFG_L', 'T_SIM_FRONT_SYSTEM_CFG_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_SIM_PAY_TYPE', 'T_SIM_PAY_TYPE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SIM_PAY_TYPE_CREATEORG') CREATE INDEX IDX_T_SIM_PAY_TYPE_CREATEORG ON T_SIM_PAY_TYPE ( FCREATEORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_SIM_PAY_TYPE_MASTER') CREATE INDEX IDX_T_SIM_PAY_TYPE_MASTER ON T_SIM_PAY_TYPE ( FMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_PAY_TYPE') CREATE  CLUSTERED INDEX IDX_SIM_PAY_TYPE ON T_SIM_PAY_TYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_SIM_PAY_TYPE_L', 'T_SIM_PAY_TYPE_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_SIM_RECEIVE_BILL', 'T_SIM_RECEIVE_BILL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_RECEIVE_BILL') CREATE  CLUSTERED INDEX IDX_SIM_RECEIVE_BILL ON T_SIM_RECEIVE_BILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_SIM_SYSTEM_ORG_REL', 'T_SIM_SYSTEM_ORG_REL', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_SYSTEM_ORG_REL') CREATE  CLUSTERED INDEX IDX_SIM_SYSTEM_ORG_REL ON T_SIM_SYSTEM_ORG_REL ( FNUMBER ,FSYSTEM_CODE );


 EXEC P_ALTERPK 'PK_SIM_SYSTEM_ORG_REL_L', 'T_SIM_SYSTEM_ORG_REL_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_SIM_SYSTEM_SOURCE_ORG', 'T_SIM_SYSTEM_SOURCE_ORG', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_SYSTEM_SOURCE_ORG_FK') CREATE  CLUSTERED INDEX IDX_SIM_SYSTEM_SOURCE_ORG_FK ON T_SIM_SYSTEM_SOURCE_ORG ( FID );


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