Re: Emailing SQL 2000 maintenance report via SMTP?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Adrian (NoSpam_at_hotmail.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 16:33:12 -0000

Keith,

I have found this useful as well, so thanks for the tip.

I am having difficulty putting in carriage returns and linefeeds and
wondered if you could help.

This works (names changed!):

exec master.dbo.xp_smtp_sendmail
 @FROM = 'Fred@mail.com',
 @TO = 'Jim@mail.com',
 @subject = 'Hello SQL Server SMTP Mail',
 @message = 'Goodbye MAPI and Outlook
 @server = 'ServerIPAddress'

But when I try and add a carriage return and line feed I get 'Incorrect
syntax near '+'' error:

exec master.dbo.xp_smtp_sendmail
 @FROM = 'Fred@mail.com',
 @TO = 'Jim@mail.com',
 @subject = 'Hello SQL Server SMTP Mail',
 @message = 'Goodbye MAPI and Outlook' + CHAR(13) + CHAR(10),
 @server = 'ServerIPAddress'

I would welcome some help.

Thanks,

Adrian

"Keith Kratochvil" <sqlguy.back2u@comcast.net> wrote in message
news:Oia5I9zGFHA.1172@TK2MSFTNGP12.phx.gbl...
> First of all, can I suggest that you not use the maintenance plan for
> backups? You can create jobs within the SQL Server Agent that will backup
> your databases. Books Online (within the SQL Server program group)
contains
> T-SQL examples of backup scripts. If you are so inclined you can also
> create jobs that perform the appropriate maintenance tasks (such as
checkdb,
> checkcatalog, updateusage, update statistics).
>
> You could use XPSMTP http://sqldev.net/xp/xpsmtp.htm to send email alerts.
>
> --
> Keith
>
>
> "Astra" <info@noemail.com> wrote in message
> news:uXPyFCzGFHA.2452@TK2MSFTNGP10.phx.gbl...
> > Hi All
> >
> > As per my post in microsoft.... server NG, I keep getting a problem
where
> my
> > DB maintenance plan just stops doing what it should, which in turn means
> > that if I don't paranoid-ly check it each day I get the scenario (like
> > today) where I find my backups haven't been working for a month!!!
> >
> > What I would like to do is email the maintenance plan to a designated
> email
> > address so that I can easily see every morning whether or not it has
> worked.
> >
> > I know the old SQL 6.5 used to provide SQL Mail, but this links in with
MS
> > Exchange Server and I don't use this. I don't even have it running on
my
> > SBS 2000 Server.
> >
> > Is there anyway in SQL 2000 that I can get it to email the report via
> SMTP?
> >
> > I'm familiar with JMail and it's COM/DLL is installed on my server if I
> > could use that.
> >
> > Thanks Robbie
> >
> >
>



Relevant Pages

  • Re: Emailing SQL 2000 maintenance report via SMTP?
    ... > "Keith Kratochvil" wrote in message ... You can create jobs within the SQL Server Agent that will ... >>> DB maintenance plan just stops doing what it should, ... >>> today) where I find my backups haven't been working for a month!!! ...
    (microsoft.public.sqlserver.programming)
  • Re: regular backups
    ... have a look at creating a maintenance plan. ... made at whatever frequency you require and it'll round-robin the files. ... backups have a filename indicating their backup time. ... Paul Ibison SQL Server MVP, ...
    (microsoft.public.sqlserver.replication)
  • Re: How to create maintenance plan to backup files and filegoups
    ... You can easily create your own scheduled job to do this though. ... > Database Maintenance Plan Wizard in SQL Server 2000 helps ... > to create a maintenance plan to perform database backups> on a regular basis. ...
    (microsoft.public.sqlserver.server)
  • Re: Remove Old Backup Files in SQL 2005
    ... Does this work in the query editor or does it give an error? ... Andrew J. Kelly SQL MVP ... When I run the maintenance plan, ... >every day and to do log file backups every hour. ...
    (microsoft.public.sqlserver.setup)
  • SQL2k backups not deleted per maintenance plan
    ... Even though the maintenance plan specifies that backups older than 20 hours ... other than "out of disk space" messages once the backups fill up the disk. ... For some reason, the SQL plan just isn't deleting the old files anymore... ...
    (microsoft.public.sqlserver.server)