xp_sendmail
向指定的收件人发送邮件和查询结果集附件。必须在执行 xp_sendmail 前启动 SQL 邮件会话。会话可以自动启动,也可以使用 xp_startmail 启动。有关自动设置 SQL 邮件会话的更多信息,请参见配置邮件配置文件。一个 SQL 邮件会话支持 SQL Server 上的所有用户,但每次只有一个用户可以发送邮件。其他发送邮件的用户自动排队等候,直到第一个用户的邮件发送出去。如果指定 query,则 xp_sendmail 作为客户端登录到 SQL Server,并执行指定的查询。SQL 邮件建立与 SQL Server 之间的单独的连接;它不与发出 xp_sendmail 的原始客户端连接共享同一连接。

解决方案 »

  1.   

    No.You don't understand my question.I know xp_sendmail
    and I once made a practise to send a e-mail to operator.after backuping the database or another jobs.the problem is how to monitor
    the harddisk space.????and then send a e-mail.
    exec sp_spaceused databasename just monitor one datbase not all the harddisk space.I want to monitor the hard disk space.???
      

  2.   

    the books tell me.you can run system monitor.and make a event log about disk space.and then make a sql server event alert to notify the operator.I don't know how to do?who can answer my question and help me????
      

  3.   

    You needn't use MSSQL2000 to make this work .
    Give this a try and see if it will work.1. run this command in windows 2000 commands window:
        diskperf -yv
    2. restart 
    3. run "control panel"-"system monitor",add a ALERT like this :
       name : disk
       counter: LogicalDisk - D: 
       ALert when the values under 20 
       action: run this program --  a program who can send a email to the opreator
      

  4.   

    Say thanks to icevi again!!!
    英雄所见.....
    I know this way.But I don't know how to design one program to send a e-mail to the operator????Can you tell me?
    Thanks icevi!!!
      

  5.   

    icevi you are online?