/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/

/** kd_1.5.9_tctb_constraint.sql **/
 EXEC P_ALTERPK 'PK_TCTB_TEMPLATE_TYPE', 'T_TCTB_TEMPLATE_TYPE', 'FID', '0';

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


 EXEC P_ALTERPK 'PK_TCTB_TEMPLATE_TYPE_DET', 'T_TCTB_TEMPLATE_TYPE_DET', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_TEMPLATE_TYPE_DET_FK') CREATE  CLUSTERED INDEX IDX_TCTB_TEMPLATE_TYPE_DET_FK ON T_TCTB_TEMPLATE_TYPE_DET ( FID );
 
 /** kd_1.5.9.2_tctb_constraint.sql
  EXEC P_ALTERPK 'PK_TCTB_TEMPLATE_TYPE', 'T_TCTB_TEMPLATE_TYPE', 'FID', '0';

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


 EXEC P_ALTERPK 'PK_TCTB_TEMPLATE_TYPE_DET', 'T_TCTB_TEMPLATE_TYPE_DET', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_TEMPLATE_TYPE_DET_FK') CREATE  CLUSTERED INDEX IDX_TCTB_TEMPLATE_TYPE_DET_FK ON T_TCTB_TEMPLATE_TYPE_DET ( FID );
**/



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/