/**Begin C:\PDM_UPGRADE\PDM1\SRM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SRM_COMPENTBASE', 'T_SRM_COMPENTBASE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_CPTBASE_PARENTID') CREATE INDEX IDX_SRM_CPTBASE_PARENTID ON T_SRM_COMPENTBASE ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_SRM_COMPENTBASE_L', 'T_SRM_COMPENTBASE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPBASEBANK', 'T_SRM_COMPBASEBANK', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPBASELINK', 'T_SRM_COMPBASELINK', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPENTDEVELOP', 'T_SRM_COMPENTDEVELOP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_COMPENTDEVELOP_PARENT') CREATE INDEX IDX_SRM_COMPENTDEVELOP_PARENT ON T_SRM_COMPENTDEVELOP ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_SRM_COMPDEVELOPENTRY', 'T_SRM_COMPDEVELOPENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPENTCUSTOMER', 'T_SRM_COMPENTCUSTOMER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_CPTCUSTOMER_PARENT') CREATE INDEX IDX_SRM_CPTCUSTOMER_PARENT ON T_SRM_COMPENTCUSTOMER ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_SRM_COMPCUSTOMERENTRY', 'T_SRM_COMPCUSTOMERENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPENTQOS', 'T_SRM_COMPENTQOS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_COMPENTQOS_PARENT') CREATE INDEX IDX_SRM_COMPENTQOS_PARENT ON T_SRM_COMPENTQOS ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_SRM_COMPQOSAPTITUDE', 'T_SRM_COMPQOSAPTITUDE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPQOSAPTITUDE_FJ', 'T_SRM_COMPQOSAPTITUDE_FJ', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPINSPECT', 'T_SRM_COMPINSPECT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPENTSCALE', 'T_SRM_COMPENTSCALE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_COMPENTSCALE_PARENT') CREATE INDEX IDX_SRM_COMPENTSCALE_PARENT ON T_SRM_COMPENTSCALE ( FPARENTID );


 EXEC P_ALTERPK 'PK_T_SRM_ENTRYGOODS', 'T_SRM_ENTRYGOODS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPARTNERENTRY', 'T_SRM_COMPARTNERENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMPRODUCTENTRY', 'T_SRM_COMPRODUCTENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_COMMAINPRODUCT', 'T_SRM_COMMAINPRODUCT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONCOMP', 'T_SRM_QUESTIONCOMP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_QUESTIONCOMP_SUP') CREATE INDEX IDX_SRM_QUESTIONCOMP_SUP ON T_SRM_QUESTIONCOMP ( FSUPPLIERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRM_QUESTIONCOMP_BIZ') CREATE INDEX IDX_SRM_QUESTIONCOMP_BIZ ON T_SRM_QUESTIONCOMP ( FBIZPARTNERID );


 EXEC P_ALTERPK 'PK_T_SRM_SUPQUESTIONNAIRE', 'T_SRM_SUPQUESTIONNAIRE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SUPQUESTIONNAIRE_BILL') CREATE INDEX IDX_SUPQUESTIONNAIRE_BILL ON T_SRM_SUPQUESTIONNAIRE ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONCOMP_L', 'T_SRM_QUESTIONCOMP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_SUPQUESTIONNAIRE_L', 'T_SRM_SUPQUESTIONNAIRE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONENTRY', 'T_SRM_QUESTIONENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_SUPQUESTIONATT', 'T_SRM_SUPQUESTIONATT', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONRANGE', 'T_SRM_QUESTIONRANGE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONRANGE_L', 'T_SRM_QUESTIONRANGE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_TPLRANGE', 'T_SRM_TPLRANGE', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_QUESTIONTPLSUPGROUP', 'T_SRM_QUESTIONTPLSUPGROUP', 'FPKID', '1';

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

  EXEC P_ALTERPK 'PK_T_SRM_QUESTIONSUPGROUP', 'T_SRM_QUESTIONSUPGROUP', 'FPKID', '1';

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


/**End C:\PDM_UPGRADE\PDM1\SRM_constraint.sql **/
