/**Begin D:\pdm\PDM_UPGRADE\pdm_new\BDM_constraint.sql **/
 EXEC P_ALTERPK 'PK_BDM_LQPT_INVOICENO', 'T_BDM_LQPT_INVOICENO', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_INVOICENO') CREATE  CLUSTERED INDEX IDX_BDM_LQPT_INVOICENO ON T_BDM_LQPT_INVOICENO ( FNSRSBH ,FINVOICE_NO );


 EXEC P_ALTERPK 'PK_BDM_LQPT_LOG', 'T_BDM_LQPT_LOG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_LOG') CREATE  CLUSTERED INDEX IDX_BDM_LQPT_LOG ON T_BDM_LQPT_LOG ( FCREATE_TIME ,FSERVICE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_LOG2') CREATE INDEX IDX_BDM_LQPT_LOG2 ON T_BDM_LQPT_LOG ( FTRACEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_LOG3') CREATE INDEX IDX_BDM_LQPT_LOG3 ON T_BDM_LQPT_LOG ( FTAX_NO ,FSERVICE );


 EXEC P_ALTERPK 'PK_BDM_LQPT_SXED', 'T_BDM_LQPT_SXED', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_SXED') CREATE  CLUSTERED INDEX IDX_BDM_LQPT_SXED ON T_BDM_LQPT_SXED ( FNSRSBH ,FSQ );


 EXEC P_ALTERPK 'PK_BDM_LQPT_SXED_LOG', 'T_BDM_LQPT_SXED_LOG', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_SXED_LOG') CREATE INDEX IDX_BDM_LQPT_SXED_LOG ON T_BDM_LQPT_SXED_LOG ( FNSRSBH ,FVERSION );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_SXED_LOG2') CREATE  CLUSTERED INDEX IDX_BDM_LQPT_SXED_LOG2 ON T_BDM_LQPT_SXED_LOG ( FINVOICE_NO );


 EXEC P_ALTERPK 'PK_BDM_LQPT_YFM', 'T_BDM_LQPT_YFM', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_LQPT_YFM') CREATE  CLUSTERED INDEX IDX_BDM_LQPT_YFM ON T_BDM_LQPT_YFM ( FNSRSBH );



/**End D:\pdm\PDM_UPGRADE\pdm_new\BDM_constraint.sql **/
