none
Attachment file is invalid.

    Question

  • Hello,

     

    I have a stored procedure with this syntax

     

    declare @filename varchar(100)

    set @filename='c:/A.pdf'

     

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name =@p_profile

    @recipients = @p_address,

    @body = @p_body,

    @subject = @p_subject,

    @file_attachments = @filename

     

     

    but when I execute it i have an error

     

      Attachment file c:/A.pdf is invalid.

     

     

    What's happen?? Thanks in advance

    Wednesday, May 02, 2007 10:54 AM

All replies

  • hi,

       It seems you are trying to load the file from invalid path. Change to

     @filename='C:\A.pdf' instead of   'c:/A.pdf'

     

    Also make sure that A.pdf file is availed in C Drive.

      

    Wednesday, May 02, 2007 11:04 AM
  • Moving to the Transact-SQL forum.
    Wednesday, May 02, 2007 1:31 PM