/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_BDM_RISK_BLACK', 'T_BDM_RISK_BLACK', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_RISK_BLACK_FK') CREATE  CLUSTERED INDEX IDX_BDM_RISK_BLACK_FK ON T_BDM_RISK_BLACK ( FID );


 EXEC P_ALTERPK 'PK_BDM_RISK_CONFIG', 'T_BDM_RISK_CONFIG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_RISK_CONFIG_ENABLE') CREATE INDEX IDX_BDM_RISK_CONFIG_ENABLE ON T_BDM_RISK_CONFIG ( FENABLE ,FRANGE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_RISK_CONFIG_MASTER') CREATE INDEX IDX_BDM_RISK_CONFIG_MASTER ON T_BDM_RISK_CONFIG ( FMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_RISK_CONFIG_NUMBER') CREATE  CLUSTERED INDEX IDX_BDM_RISK_CONFIG_NUMBER ON T_BDM_RISK_CONFIG ( FNUMBER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_RISK_CONIFG_ORG') CREATE INDEX IDX_BDM_RISK_CONIFG_ORG ON T_BDM_RISK_CONFIG ( FCREATEORGID );


 EXEC P_ALTERPK 'PK_BDM_RISK_CONFIG_L', 'T_BDM_RISK_CONFIG_L', 'FPKID', '0';

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



/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_constraint.sql **/
