/**Begin D:\PDM_UPGRADE\PDM1\TSRBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_TSRBD_SSCTASKHIS', 'T_TSRBD_SSCTASKHIS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TSRBDSSCHIS_FBILLID') CREATE INDEX IDX_TSRBDSSCHIS_FBILLID ON T_TSRBD_SSCTASKHIS ( FBILLID );

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

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

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

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

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

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

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


 EXEC P_ALTERPK 'PK_T_TSRBD_SSCTASKHIS_Q', 'T_TSRBD_SSCTASKHIS_Q', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_TSRBD_SSCTASK', 'T_TSRBD_SSCTASK', 'FID', '1';

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

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

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

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

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

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

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


 EXEC P_ALTERPK 'PK_TSRBD_SSCTASK_Q', 'T_TSRBD_SSCTASK_Q', 'FID', '1';

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



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