如题:有个表名为table1,我想用触发器实现“当table1中的字段gx如果有数值更新,就调用C盘下名为test.exe的外部程序”谢谢

解决方案 »

  1.   

    create trigger tg_test on table1
    for update 
    as
      if update(gx)
      begin
       你的语句
      end 
    go
      

  2.   

    create trigger tg_test on table1
    for update 
    as
      if update(gx)
      begin
       exec master..xp_cmdshell 'C:\test.exe'
      end 
    gotry
      

  3.   

    --try:
    create trigger trig_update_table1 on table1 
    for update as
    if update(gx)
    begin
    EXEC master..xp_cmdshell 'c:\test.exe'
    end
      

  4.   


    create trigger tg_test on table1
    for update 
    as
      if update(gx)
      begin
        exec master..xp_cmdshell 'C:\test.exe'
      end 
    go
      

  5.   


    master..xp_cmdshell 可以实现这个功能。你可以把你的步骤列出来,让大伙看看,是不是操作有问题。
      

  6.   

    你直接在查詢分析器中執行以下語句看看exec master..xp_cmdshell 'C:\test.exe'看能否執行test.exe