/**Begin D:\PDM_UPGRADE\PDM1\HDMSSC_constraint.sql **/
 EXEC P_ALTERPK 'PK_HDM_SSCTASK', 'T_HDM_SSCTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FSSCID') CREATE INDEX IDX_HDMTASK_FSSCID ON T_HDM_SSCTASK ( FSSCID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FPERSONID') CREATE INDEX IDX_HDMTASK_FPERSONID ON T_HDM_SSCTASK ( FPERSONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FBILLTYPEID') CREATE INDEX IDX_HDMTASK_FBILLTYPEID ON T_HDM_SSCTASK ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FTASKTYPEID') CREATE INDEX IDX_HDMTASK_FTASKTYPEID ON T_HDM_SSCTASK ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FBILLLONGID') CREATE INDEX IDX_HDMTASK_FBILLLONGID ON T_HDM_SSCTASK ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FCREATETIME') CREATE INDEX IDX_HDMTASK_FCREATETIME ON T_HDM_SSCTASK ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK' AND KSQL_INDNAME = 'IDX_HDMTASK_FRECEIVETIME') CREATE INDEX IDX_HDMTASK_FRECEIVETIME ON T_HDM_SSCTASK ( FRECEIVETIME );


 EXEC P_ALTERPK 'PK_HDM_SSCTASK_Q', 'T_HDM_SSCTASK_Q', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASK_Q' AND KSQL_INDNAME = 'IDX_HDMTASK_FOPERATORID') CREATE INDEX IDX_HDMTASK_FOPERATORID ON T_HDM_SSCTASK_Q ( FOPERATORID );


 EXEC P_ALTERPK 'PK_HDM_SSCTASKHIS', 'T_HDM_SSCTASKHIS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FSSCID') CREATE INDEX IDX_HDMTASKHIS_FSSCID ON T_HDM_SSCTASKHIS ( FSSCID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FPERSONID') CREATE INDEX IDX_HDMTASKHIS_FPERSONID ON T_HDM_SSCTASKHIS ( FPERSONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FBILLTYPEID') CREATE INDEX IDX_HDMTASKHIS_FBILLTYPEID ON T_HDM_SSCTASKHIS ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FTASKTYPEID') CREATE INDEX IDX_HDMTASKHIS_FTASKTYPEID ON T_HDM_SSCTASKHIS ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FBILLLONGID') CREATE INDEX IDX_HDMTASKHIS_FBILLLONGID ON T_HDM_SSCTASKHIS ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FCREATETIME') CREATE INDEX IDX_HDMTASKHIS_FCREATETIME ON T_HDM_SSCTASKHIS ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FRECEIVETIME') CREATE INDEX IDX_HDMTASKHIS_FRECEIVETIME ON T_HDM_SSCTASKHIS ( FRECEIVETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FSOURCETASKID') CREATE INDEX IDX_HDMTASKHIS_FSOURCETASKID ON T_HDM_SSCTASKHIS ( FSOURCETASKID );


 EXEC P_ALTERPK 'PK_HDM_SSCTASKHIS_Q', 'T_HDM_SSCTASKHIS_Q', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_HDM_SSCTASKHIS_Q' AND KSQL_INDNAME = 'IDX_HDMTASKHIS_FOPERATORID') CREATE INDEX IDX_HDMTASKHIS_FOPERATORID ON T_HDM_SSCTASKHIS_Q ( FOPERATORID );



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