/**Begin D:\PDM_UPGRADE\PDM1\HRCS_constraint.sql **/
 EXEC P_ALTERPK 'PK_HRCS_SSCTASK_Q', 'T_HRCS_SSCTASK_Q', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FOPERATORID') CREATE INDEX IDX_HRCSSSCTASK_FOPERATORID ON T_HRCS_SSCTASK_Q ( FOPERATORID );


 EXEC P_ALTERPK 'PK_HRCS_SSCTASKHIS_Q', 'T_HRCS_SSCTASKHIS_Q', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FOPERATORID') CREATE INDEX IDX_HRCSSTHIS_FOPERATORID ON T_HRCS_SSCTASKHIS_Q ( FOPERATORID );


 EXEC P_ALTERPK 'PK_HRCS_SSCTASK', 'T_HRCS_SSCTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FSSCID') CREATE INDEX IDX_HRCSSSCTASK_FSSCID ON T_HRCS_SSCTASK ( FSSCID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FPERSONID') CREATE INDEX IDX_HRCSSSCTASK_FPERSONID ON T_HRCS_SSCTASK ( FPERSONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FBILLTYPEID') CREATE INDEX IDX_HRCSSSCTASK_FBILLTYPEID ON T_HRCS_SSCTASK ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FTASKTYPEID') CREATE INDEX IDX_HRCSSSCTASK_FTASKTYPEID ON T_HRCS_SSCTASK ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FBILLLONGID') CREATE INDEX IDX_HRCSSSCTASK_FBILLLONGID ON T_HRCS_SSCTASK ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FCREATETIME') CREATE INDEX IDX_HRCSSSCTASK_FCREATETIME ON T_HRCS_SSCTASK ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSSCTASK_FRECEIVETIME') CREATE INDEX IDX_HRCSSSCTASK_FRECEIVETIME ON T_HRCS_SSCTASK ( FRECEIVETIME );


 EXEC P_ALTERPK 'PK_HRCS_SSCTASKHIS', 'T_HRCS_SSCTASKHIS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FSSCID') CREATE INDEX IDX_HRCSSTHIS_FSSCID ON T_HRCS_SSCTASKHIS ( FSSCID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FPERSONID') CREATE INDEX IDX_HRCSSTHIS_FPERSONID ON T_HRCS_SSCTASKHIS ( FPERSONID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FBILLTYPEID') CREATE INDEX IDX_HRCSSTHIS_FBILLTYPEID ON T_HRCS_SSCTASKHIS ( FBILLTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FTASKTYPEID') CREATE INDEX IDX_HRCSSTHIS_FTASKTYPEID ON T_HRCS_SSCTASKHIS ( FTASKTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FBILLLONGID') CREATE INDEX IDX_HRCSSTHIS_FBILLLONGID ON T_HRCS_SSCTASKHIS ( FBILLLONGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FCREATETIME') CREATE INDEX IDX_HRCSSTHIS_FCREATETIME ON T_HRCS_SSCTASKHIS ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FRECEIVETIME') CREATE INDEX IDX_HRCSSTHIS_FRECEIVETIME ON T_HRCS_SSCTASKHIS ( FRECEIVETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_HRCSSTHIS_FSOURCETASKID') CREATE INDEX IDX_HRCSSTHIS_FSOURCETASKID ON T_HRCS_SSCTASKHIS ( FSOURCETASKID );



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