/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_constraint.sql **/
 /**EXEC P_ALTERPK 'PK_TCVAT_NSRXX', 'T_TCVAT_NSRXX', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_NSRXX_NUM') CREATE  CLUSTERED INDEX IDX_T_TCTB_NSRXX_NUM ON T_TCVAT_NSRXX ( FNSRSBH ,FSKSSQQ ,FSKSSQZ );**/


 EXEC P_ALTERPK 'PK_TCTB_DECLARE_HIS', 'T_TCTB_DECLARE_HIS', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_DECLARE_HIS_SSID') CREATE  CLUSTERED INDEX IDX_T_TCTB_DECLARE_HIS_SSID ON T_TCTB_DECLARE_HIS ( FCELLID ,FSBBID );


 /**EXEC P_ALTERPK 'PK_TCTB_FORMULA', 'T_TCTB_FORMULA', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_FORMULA_KEY') CREATE  CLUSTERED INDEX IDX_T_TCTB_FORMULA_KEY ON T_TCTB_FORMULA ( FFORMULAKEY );**/


 EXEC P_ALTERPK 'PK_TCTB_TEMPLATE', 'T_TCTB_TEMPLATE', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_TCTB_TEMPLATE') CREATE  CLUSTERED INDEX IDX_T_TCTB_TEMPLATE ON T_TCTB_TEMPLATE ( FTYPE ,FSTARTDATE );

/**
 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 );
**/

 EXEC P_ALTERPK 'PK_TCTB_INVOICE_SETTING', 'T_TCTB_INVOICE_SETTING', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TCTB_INVOICE_SETTING') CREATE  CLUSTERED INDEX IDX_TCTB_INVOICE_SETTING ON T_TCTB_INVOICE_SETTING ( FBILLNO );



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