/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SIM_RED_CONFIRM_BILL', 'T_SIM_RED_CONFIRM_BILL', 'FID', '0';

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

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

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


 EXEC P_ALTERPK 'PK_T_SIM_RED_CONFIRM_BILL_L', 'T_SIM_RED_CONFIRM_BILL_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_SIM_RED_CONFIRM_ITEMS', 'T_SIM_RED_CONFIRM_ITEMS', 'FENTRYID', '0';

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



/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
