/**Begin C:\PDM_UPGRADE\PDM1\PBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_PBD_CONTROLDIMENSION', 'T_PBD_CONTROLDIMENSION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_DIMENSION_FBASEDATAID') CREATE INDEX IDX_PBD_DIMENSION_FBASEDATAID ON T_PBD_CONTROLDIMENSION ( FBASEDATATYPEID );


 EXEC P_ALTERPK 'PK_T_PBD_CONTROLDIMENSION_L', 'T_PBD_CONTROLDIMENSION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_BILLREGISTER', 'T_PBD_BILLREGISTER', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_BILLREGISTER_FBILLID') CREATE INDEX IDX_PBD_BILLREGISTER_FBILLID ON T_PBD_BILLREGISTER ( FBILLENTITYID );


 EXEC P_ALTERPK 'PK_T_PBD_BILLREGISTER_L', 'T_PBD_BILLREGISTER_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_BILLREGISTENTRY', 'T_PBD_BILLREGISTENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_BILLREGISTERENTRY_FID') CREATE INDEX IDX_PBD_BILLREGISTERENTRY_FID ON T_PBD_BILLREGISTENTRY ( FID ,FSEQ );

 EXEC P_ALTERPK 'PK_T_PBD_CONTROLTYPE', 'T_PBD_CONTROLTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_CONTROLTYPE_FINTERFACE') CREATE INDEX IDX_PBD_CONTROLTYPE_FINTERFACE ON T_PBD_CONTROLTYPE ( FINTERFACE );


 EXEC P_ALTERPK 'PK_T_PBD_CONTROLTYPE_L', 'T_PBD_CONTROLTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PBD_DIMENSIONENTRY', 'T_PBD_DIMENSIONENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_DIMENSIONENTRY_FID') CREATE INDEX IDX_PBD_DIMENSIONENTRY_FID ON T_PBD_DIMENSIONENTRY ( FID ,FSEQ );


  EXEC P_ALTERPK 'PK_T_PBD_CONTROLSCHEME', 'T_PBD_CONTROLSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PBD_CONTROLSCHEME_BILL') CREATE INDEX IDX_PBD_CONTROLSCHEME_BILL ON T_PBD_CONTROLSCHEME ( FBILLENTITYID );


 EXEC P_ALTERPK 'PK_T_PBD_CONTROLSCHEME_L', 'T_PBD_CONTROLSCHEME_L', 'FPKID', '1';

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



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