zoukankan      html  css  js  c++  java
  • hubbledotnet 定时更新索引

    文章:http://www.cnblogs.com/eaglet/archive/2010/08/25/1808143.html

    这里用的是update模式创建表

    1、首先在数据库中创建触发器表 

    CREATE TABLE [HBTrigger_job_SearchKey] (

    [Serial] [bigint]  IDENTITY (1, 1)  NOT NULL,

    [Id] [intNOT NULL,

    [Opr] [char]  (16) NULL,

    [Fields] [nvarchar]  (4000) NULL)

     

    ALTER TABLE [HBTrigger_job_SearchKey] WITH NOCHECK ADD  CONSTRAINT [PK_HBTrigger_job_SearchKey] PRIMARY KEY  NONCLUSTERED ( [Serial] )

    SET IDENTITY_INSERT [HBTrigger_job_SearchKey] ON

    2、在job_SearchKey 创建修改 删除 触发器

    修改触发器:

    create Trigger [dbo].[HBTrigger_job_SearchKey_Update]
        On [dbo].[job_SearchKey]                        
        for Update                         
    
        As                                       
        DECLARE @updateFields nvarchar(4000)
        set @updateFields = ''
    
        if Update(keyid)          
        begin
        set @updateFields = @updateFields + 'keyid,'
        end       
    
        if Update(keyword)          
        begin
        set @updateFields = @updateFields + 'keyword,'
        end       
    
        if Update([Count])          
        begin
        set @updateFields = @updateFields + 'Count,'
        end       
    
        if Update(type)          
        begin
        set @updateFields = @updateFields + 'type,'
        end       
    
        if Update(addTime)          
        begin
        set @updateFields = @updateFields + 'addTime,'
        end   
         if Update(upTime)          
        begin
        set @updateFields = @updateFields + 'upTime,'
        end   
         if Update(RecordCount)          
        begin
        set @updateFields = @updateFields + 'RecordCount,'
        end   
    
        if @updateFields <> ''
        begin
        insert into HBTrigger_job_SearchKey select keyid, 'Update',  @updateFields from Inserted
    end
    

    删除触发器

    create Trigger [dbo].[HBTrigger_job_SearchKey_Delete]
     
    On [dbo].[job_SearchKey]
     
    for Delete
     
    As
     
    insert into HBTrigger_job_SearchKey select keyid, 'Delete', '' from Deleted
    

    注:插入操作不用添加触发器hubbledotnet会自动处理

    3、打开hubbledotnet(Query Analyzer) 在job_SearchKey右键选择Table InfoàAttributes

             TableSynchronization设置为true,TriggerTableName 添写第一步创建的触发器表名

    4、打开hubbledotnet(Query Analyzer)点击Managerment菜单 选择

    Task scheduler managerment 点击Add

    exec SP_SynchronizeTable 'job_SearchKey', 5000, 2 是hubbledotnet固定

    文章地址:http://www.cnblogs.com/eaglet/archive/2011/03/02/1969219.html

  • 相关阅读:
    triplet loss 在深度学习中主要应用在什么地方?有什么明显的优势?
    一个评测指标就是MAP(Mean Average Precision)平均精度均值。
    机器学习术语中英对照表
    logistic softmax
    mysql导出导入sql文件方法(linux)
    mysql分区表
    matplotlib安装错误依赖问题解决
    linux命令集合
    linux下安装或升级GCC4.8.2,以支持C++11标准[转]
    linux 如何显示一个文件的某几行(中间几行)
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/2059867.html
Copyright © 2011-2022 走看看