Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    São Paulo, Brasil
    Posts
    4

    Unanswered: Sending SQL report through email

    How can I send email messages automatically attaching a weekly report attaching it to The name of the generated fiel should be Score<currentdate>, where current date = yy/mm/dd ?

  2. #2
    Join Date
    Sep 2003
    Posts
    212

    Re: Sending SQL report through email

    Originally posted by cassianorsilva
    How can I send email messages automatically attaching a weekly report attaching it to The name of the generated fiel should be Score<currentdate>, where current date = yy/mm/dd ?
    can filesname contain '/' character?

  3. #3
    Join Date
    Sep 2003
    Posts
    212
    newho, check out xp_SendMail command in BOL. I'm sure you can attached files using this command.

    xp_sendmail {[@recipients =] 'recipients [;...n]'}
    [,[@message =] 'message']
    [,[@query =] 'query']
    [,[@attachments =] 'attachments [;...n]']
    [,[@copy_recipients =] 'copy_recipients [;...n]'
    [,[@blind_copy_recipients =] 'blind_copy_recipients [;...n]'
    [,[@subject =] 'subject']
    [,[@type =] 'type']
    [,[@attach_results =] 'attach_value']
    [,[@no_output =] 'output_value']
    [,[@no_header =] 'header_value']
    [,[@width =] width]
    [,[@separator =] 'separator']
    [,[@echo_error =] 'echo_value']
    [,[@set_user =] 'user']
    [,[@dbuse =] 'database']

  4. #4
    Join Date
    Nov 2003
    Location
    São Paulo, Brasil
    Posts
    4

    Question

    Thank you !

    Does anybody have any further suggestions ?

  5. #5
    Join Date
    Sep 2003
    Posts
    212
    declare @attach char(100)
    set @attach = 'C:\Yourreports.rpt;C:\Yourreport_3_01_15_4.xxx'
    begin
    Exec Master..xp_SendMail
    @recipients = 'joe.schmo@dontknow.com',
    @subject = 'Joe Schmo',
    @message = 'Your msg',
    @attachments = @attach
    end

    Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •