/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\IFM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY', 'T_IFM_INNERACCTAPPLY', 'FID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCT_L', 'T_IFM_INNERACCT_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCT_LK', 'T_IFM_INNERACCT_LK', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCT_WB', 'T_IFM_INNERACCT_WB', 'FENTRYID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY_L', 'T_IFM_INNERACCTAPPLY_L', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTEXC', 'T_IFM_INNERACCTEXC', 'FDATAID,FUSEORGID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'T_IFM_INNERACCTEXC_ID') CREATE  CLUSTERED INDEX T_IFM_INNERACCTEXC_ID ON T_IFM_INNERACCTEXC ( FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCT_TC', 'T_IFM_INNERACCT_TC', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_INNERACCT_TC_FID') CREATE  CLUSTERED INDEX IDX_IFM_INNERACCT_TC_FID ON T_IFM_INNERACCT_TC ( FTBILLID );


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY_LK', 'T_IFM_INNERACCTAPPLY_LK', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY_TC', 'T_IFM_INNERACCTAPPLY_TC', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_INNERACCTAP_TC_FID') CREATE  CLUSTERED INDEX IDX_IFM_INNERACCTAP_TC_FID ON T_IFM_INNERACCTAPPLY_TC ( FTBILLID );


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY_WB', 'T_IFM_INNERACCTAPPLY_WB', 'FENTRYID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTUSEREG', 'T_IFM_INNERACCTUSEREG', 'FUSEORGID,FDATAID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_INNERACCTUSEREG_FID') CREATE  CLUSTERED INDEX IDX_IFM_INNERACCTUSEREG_FID ON T_IFM_INNERACCTUSEREG ( FDATAID );


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCTAPPLY_CR', 'T_IFM_INNERACCTAPPLY_CR', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_IFM_INNERACCT_CR', 'T_IFM_INNERACCT_CR', 'FPKID', '0';

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


 EXEC P_ALTERPK 'PK_T_IFM_INNERACCT', 'T_IFM_INNERACCT', 'FID', '0';

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



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\IFM_constraint.sql **/
