exec master..xp_cmdshell 'del ...'

解决方案 »

  1.   

    你是用的transact_sql 语言吗
      

  2.   

    是阿……在SQL语句中写exec master..xp_cmdshell 'del ...'
      

  3.   

    我是在服务器代理建了个作业,以上语句可以在怎样写呢,我的库是MessageCenter,物理地址是
    D:\messagecenter\attaches\下,请告诉我详细点,我对transact_sql 语言不熟
      

  4.   

    怎么不行啊?
    exec master..xp_cmdshell 'del D:\messagecenter\attaches\'是这样吗
      

  5.   

    建立一个JOB在Comment里面用exec master..xp_cmdshell 'del ...'
    在时间里选择每周执行一次.
      

  6.   

    exec master..xp_cmdshell 'del D:\messagecenter\attaches /s /q' (保留空文件夹)
    或者
    exec master..xp_cmdshell 'rd D:\messagecenter\attaches /s /q'   (连文件夹一块删)