February 15, 2006 at 11:18 am
I have heard that you can set up alert emails for your server if there's an error. I am interested in setting this up...Anyone have this set up?
Thanks
February 15, 2006 at 1:32 pm
There's a couple of caveats to this. First, email has to be set up on the machine running SQL Server. Once it is, it's very easy to set up an email message from a stored procedure. Try the following sample syntax in Query Analyzer:
exec Master.dbo.xp_sendmail 'email address here', @subject='Your subject', @message='Your text message here'
Check out xp_sendmail in Books Online to see how to add queries, attachments, etc.
I don't think it's possible to concatenate straight text with a variable into the procedure variable"@message". Declare a variable such as @strMessage, set @strMessage to whatever you want (including concatenation) and finally set @message=@strMessage in the procedure.
Elliott
February 16, 2006 at 11:27 am
so i need to set up a specific email for my server? i can't have it bounce and email out to another email? like if this happens email to {insert email address}
or do i need to give the sql server it's own email and have it bounce it out from like
server@server.com?? you know
could you be a tad more specific? heheh thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply