/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_DATASOURCECATALOG', 'T_BCM_DATASOURCECATALOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_DATASOURCECATALOG' AND KSQL_INDNAME = 'IDX_BCM_DATASOURCECATALOG') CREATE INDEX IDX_BCM_DATASOURCECATALOG ON T_BCM_DATASOURCECATALOG ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_DATASOURCECATALOG_L', 'T_BCM_DATASOURCECATALOG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_DATASOURCECATALOG_L' AND KSQL_INDNAME = 'IDX_BCM_DATASOURCECATALOG_L') CREATE INDEX IDX_BCM_DATASOURCECATALOG_L ON T_BCM_DATASOURCECATALOG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_ISDATASOURCE', 'T_BCM_ISDATASOURCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ISDATASOURCE' AND KSQL_INDNAME = 'IDX_BCM_ISDATASOURCE') CREATE INDEX IDX_BCM_ISDATASOURCE ON T_BCM_ISDATASOURCE ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ISDATASOURCE' AND KSQL_INDNAME = 'IDX_BCM_ISDATASOURCENAME') CREATE INDEX IDX_BCM_ISDATASOURCENAME ON T_BCM_ISDATASOURCE ( FCUSNAME );


 EXEC P_ALTERPK 'PK_T_BCM_ISDATASOURCE_L', 'T_BCM_ISDATASOURCE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ISDATASOURCE_L' AND KSQL_INDNAME = 'IDX_BCM_ISDATASOURCE_L') CREATE INDEX IDX_BCM_ISDATASOURCE_L ON T_BCM_ISDATASOURCE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_ISDATASOURCEITEM', 'T_BCM_ISDATASOURCEITEM', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ISDATASOURCEITEM' AND KSQL_INDNAME = 'IDX_BCM_ISDATASOURCEITEM') CREATE INDEX IDX_BCM_ISDATASOURCEITEM ON T_BCM_ISDATASOURCEITEM ( FID );



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