/**Begin D:\PDM_UPGRADE\PDM1\BCM_constraint.sql **/


 EXEC P_ALTERPK 'PK_T_BCM_PAPERTEMPLATE', 'T_BCM_PAPERTEMPLATE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PAPERTEMP') CREATE INDEX IDX_BCM_PAPERTEMP ON T_BCM_PAPERTEMPLATE ( FMODELID ,FSCENARIOID );


 EXEC P_ALTERPK 'PK_T_BCM_PAPERTEMPLATE_S', 'T_BCM_PAPERTEMPLATE_S', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PTEMP_S') CREATE INDEX IDX_BCM_PTEMP_S ON T_BCM_PAPERTEMPLATE_S ( FTEMPLATEID );


 EXEC P_ALTERPK 'PK_T_BCM_PAPERTEMPLATE_L', 'T_BCM_PAPERTEMPLATE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_PAPERTPLCATALOG', 'T_BCM_PAPERTPLCATALOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PTPLCATALOG') CREATE INDEX IDX_BCM_PTPLCATALOG ON T_BCM_PAPERTPLCATALOG ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_PAPERTPLCATALOG_L', 'T_BCM_PAPERTPLCATALOG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_PAPERDISTRIBUTION', 'T_BCM_PAPERDISTRIBUTION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_PAPERDIS') CREATE INDEX IDX_BCM_PAPERDIS ON T_BCM_PAPERDISTRIBUTION ( FMODELID );



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