/**Begin D:\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_INVSHEETENTRY', 'T_BCM_INVSHEETENTRY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVSHEETENTRY') CREATE INDEX IDX_BCM_INVSHEETENTRY ON T_BCM_INVSHEETENTRY ( FMODELID ,FTEMPLATEID );


 EXEC P_ALTERPK 'PK_T_BCM_INVSHEETENTRY_L', 'T_BCM_INVSHEETENTRY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVSHEETROW', 'T_BCM_INVSHEETROW', 'FENTRYID', '1';

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



 EXEC P_ALTERPK 'PK_T_BCM_INVSHEET', 'T_BCM_INVSHEET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVSHEETMSYPC') CREATE INDEX IDX_BCM_INVSHEETMSYPC ON T_BCM_INVSHEET ( FMODELID ,FSCENARIOID ,FYEARID ,FPERIODID ,FCSLSCHEMEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_INVSHEETE') CREATE INDEX IDX_BCM_INVSHEETE ON T_BCM_INVSHEET ( FENTITYID );


 EXEC P_ALTERPK 'PK_T_BCM_INVSHEET_L', 'T_BCM_INVSHEET_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVSHEETACCLAYOUT', 'T_BCM_INVSHEETACCLAYOUT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_INVSHEET_S', 'T_BCM_INVSHEET_S', 'FID', '1';

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


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