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

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_ISOMERISM_CREATETIME') CREATE  CLUSTERED INDEX IDX_SIM_ISOMERISM_CREATETIME ON T_SIM_ISOMERISM_BILL_DATA ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_ISOMERISM_ORGID') CREATE INDEX IDX_SIM_ISOMERISM_ORGID ON T_SIM_ISOMERISM_BILL_DATA ( FORGID );
 

 EXEC P_ALTERPK 'PK_SIM_ISOMERISM_BILL_INV', 'T_SIM_ISOMERISM_BILL_INV', 'FENTRYID', '0';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_ISOMERISM_INV_CODENO') CREATE INDEX IDX_SIM_ISOMERISM_INV_CODENO ON T_SIM_ISOMERISM_BILL_INV ( FINVOICECODE ,FINVOICENO );


 EXEC P_ALTERPK 'PK_SIM_ISOMERISM_ITEM_DATA', 'T_SIM_ISOMERISM_ITEM_DATA', 'FENTRYID', '0';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_ISOMERISM_ITEMTAX_CODE') CREATE INDEX IDX_SIM_ISOMERISM_ITEMTAX_CODE ON T_SIM_ISOMERISM_ITEM_DATA ( FTAX_CODE );


 EXEC P_ALTERPK 'PK_SIM_ISOMERISM_PAY_DATA', 'T_SIM_ISOMERISM_PAY_DATA', 'FENTRYID', '0';

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



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