SQL Server Performance

Triggerring mail from SQL server

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by valarmathi, Jun 30, 2005.

  1. valarmathi New Member

    Hi...
    I am working in the triggering mail from SQL server.




    declare @Mailobj as int
    declare @hr as int
    exec master.. sp_oacreate 'dllname.clsname', @Mailobj out,1
    exec master..sp_oageterrorinfo
    exec master..sp_oamethod @Mailobj,'Testmail',null,@Toid='',@Fromid='',@CCid='',@BCCid='',@Subject='mail',@Textbody='Hello world',@strError=''
    exec master..sp_oageterrorinfo



    Error: 0x800401F3

    Source: ODSOLE Extended Procedure

    Error Description: Invalid class string

    Help file: NULL

    Help ID:0










    Error: 0x80042725

    Source: ODSOLE Extended Procedure

    Error Description: sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]

    Help file: NULL

    Help ID:0




    But if i execute the code below without SP_geterrorinfo, as below



    declare @Mailobj as int
    exec master.. sp_oacreate 'dllname.classname', @Mailobj out,1
    exec master..sp_oamethod @Mailobj,'Testmail',null,@Toid='',@Fromid='',@CCid='',@BCCid='',@Subject='mail',@Textbody='Hello world',@strError=''



    The command completed successfully, but i didnt get any error message.


  2. satya Moderator

Share This Page