/**Begin D:\PDM_UPGRADE\PDM1\TM_constraint.sql **/
 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE', 'T_TM_COMBREQNOTE', 'FID', '0';

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


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_FWD', 'T_TM_COMBREQNOTE_FWD', 'FENTRYID', '0';

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


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_OPTIONS', 'T_TM_COMBREQNOTE_OPTIONS', 'FENTRYID', '0';

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


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_ORG', 'T_TM_COMBREQNOTE_ORG', 'FPKID', '0';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INX_TM_COMBREQNOTE_ORG') CREATE INDEX INX_TM_COMBREQNOTE_ORG ON T_TM_COMBREQNOTE_ORG ( FBASEDATAID );


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_PRODUCT', 'T_TM_COMBREQNOTE_PRODUCT', 'FPKID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TM_COMBREQNOTE_PRODUCT') CREATE INDEX IDX_TM_COMBREQNOTE_PRODUCT ON T_TM_COMBREQNOTE_PRODUCT ( FBASEDATAID );

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


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_SPOT', 'T_TM_COMBREQNOTE_SPOT', 'FENTRYID', '0';

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


 EXEC P_ALTERPK 'PK_TM_COMBREQNOTE_SWAPS', 'T_TM_COMBREQNOTE_SWAPS', 'FENTRYID', '0';

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



/**End D:\PDM_UPGRADE\PDM1\TM_constraint.sql **/
