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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_APTITUDE') CREATE  CLUSTERED INDEX IDX_T_TCTB_APTITUDE ON T_TCTB_APTITUDE ( FORGID );


 EXEC P_ALTERPK 'PK_T_TCTB_BD_BANK', 'T_TCTB_BD_BANK', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_BD_BANK') CREATE  CLUSTERED INDEX IDX_T_TCTB_BD_BANK ON T_TCTB_BD_BANK ( FORGID );


 EXEC P_ALTERPK 'PK_T_TCTB_BD_BASE', 'T_TCTB_BD_BASE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_BD_BASE') CREATE  CLUSTERED INDEX IDX_T_TCTB_BD_BASE ON T_TCTB_BD_BASE ( FORGID );


 EXEC P_ALTERPK 'PK_T_TCTB_BD_CATEGORY', 'T_TCTB_BD_CATEGORY', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_BD_CATEGORY') CREATE  CLUSTERED INDEX IDX_T_TCTB_BD_CATEGORY ON T_TCTB_BD_CATEGORY ( FORGID );


 EXEC P_ALTERPK 'PK_T_TCTB_BD_REGISTERTYPE', 'T_TCTB_BD_REGISTERTYPE', 'FID', '0';

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


 EXEC P_ALTERPK 'PK_T_TCTB_BD_SHAREHOLDER', 'T_TCTB_BD_SHAREHOLDER', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_BD_SHAREHOLDER') CREATE  CLUSTERED INDEX IDX_T_TCTB_BD_SHAREHOLDER ON T_TCTB_BD_SHAREHOLDER ( FORGID );


 EXEC P_ALTERPK 'PK_T_TCTB_BD_REGISTERTYPE_L', 'T_TCTB_BD_REGISTERTYPE_L', 'FPKID', '0';

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


 EXEC p_AlterPK 'PK_T_TCTB_ORG', 'T_TCTB_ORG', 'FID', '0';
EXEC p_DropIdx 'IDX_T_TCTB_ORG_FNUMBER', 'T_TCTB_ORG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_ORG_FNUMBER') CREATE  CLUSTERED INDEX IDX_T_TCTB_ORG_FNUMBER ON T_TCTB_ORG ( FNUMBER );


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