Re: Databasename Variable

From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 02/24/05


Date: Thu, 24 Feb 2005 13:51:51 -0500

You can't concatenate there, you'll have to build the message first.

DECLARE @msg VARCHAR(255), @rc INT
SET @msg = @databasename + ' Backup Succeeded.'
EXEC @rc = master..xp_smtp_sendmail
    ...
    @message = @msg,

What does this have to do with DTS, setup, security??? Followups set to
.server only.

-- 
http://www.aspfaq.com/
(Reverse address to reply.)
"Gabe Matteson" <gmatteson@inquery.biz.nospam> wrote in message
news:##3QnDqGFHA.544@TK2MSFTNGP12.phx.gbl...
> declare @rc int
> exec @rc = master.dbo.xp_smtp_sendmail
>  @FROM  = N'SRVDB1@mydomain.com',
>  @TO   = N'gmatteson@mydomain',
>  @priority  = N'HIGH',
>  @subject  = N'Process Success',
>  @message  = N'Database Backup Succeeded.', - Rather than putting Database
> Backup Succeeded, I would like to put "@databasename Backup Succeeded".
>  @server   = N'mail.mydomain.com',
>  @attachment  = N'F:\TEST.txt'
> select RC = @rc
> GO
>
> Anyone know how to do this, this is my first stored procedure and I really
> have no idea how the syntax works! thanks.
>
>


Relevant Pages

  • Re: Databasename Variable
    ... you'll have to build the message first. ... What does this have to do with DTS, setup, security??? ... Followups set to ...
    (microsoft.public.sqlserver.server)
  • Re: Databasename Variable
    ... you'll have to build the message first. ... What does this have to do with DTS, setup, security??? ... Followups set to ...
    (microsoft.public.sqlserver.setup)
  • Re: Databasename Variable
    ... you'll have to build the message first. ... What does this have to do with DTS, setup, security??? ... Followups set to ...
    (microsoft.public.sqlserver.clients)
  • Re: Databasename Variable
    ... you'll have to build the message first. ... What does this have to do with DTS, setup, security??? ... Followups set to ...
    (microsoft.public.sqlserver.dts)