/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_BDM_DECLARATION', 'T_BDM_DECLARATION', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_DECLARATION_ORG') CREATE  CLUSTERED INDEX IDX_BDM_DECLARATION_ORG ON T_BDM_DECLARATION ( FCREATEORGID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_DECLARATION_TAXNO') CREATE INDEX IDX_BDM_DECLARATION_TAXNO ON T_BDM_DECLARATION ( FTAXNUMBER );


 EXEC P_ALTERPK 'PK_BDM_DECLARATION_L', 'T_BDM_DECLARATION_L', 'FPKID', '0';

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



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