/**Begin C:\anzhuang\PDM_UPGRADE\PDM1\TCTB_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_ORGMAP_BUSOBJECT', 'T_TCTB_ORGMAP_BUSOBJECT', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_ORGMAP_BUSOBJECT_FK') CREATE INDEX IDX_TCTB_ORGMAP_BUSOBJECT_FK ON T_TCTB_ORGMAP_BUSOBJECT ( FENTRYID );


 EXEC P_ALTERPK 'PK_TCTB_ORGMAP_TAXORG', 'T_TCTB_ORGMAP_TAXORG', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_ORGMAP_TAXORG_FK') CREATE INDEX IDX_TCTB_ORGMAP_TAXORG_FK ON T_TCTB_ORGMAP_TAXORG ( FID );


 EXEC P_ALTERPK 'PK_TCTB_ORGMAPENTITY', 'T_TCTB_ORGMAPENTITY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ORGMAP_NUMBER') CREATE INDEX IDX_ORGMAP_NUMBER ON T_TCTB_ORGMAPENTITY ( FNUMBER );


 EXEC P_ALTERPK 'PK_TCTB_ORGMAPENTITY_L', 'T_TCTB_ORGMAPENTITY_L', 'FPKID', '1';

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



/**End C:\anzhuang\PDM_UPGRADE\PDM1\TCTB_constraint.sql **/
