Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Database maintenance plan Expand / Collapse
Posted Sunday, October 12, 2008 10:54 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, December 1, 2016 9:51 PM
Points: 1,184, Visits: 3,465
Through Database maintenance plan i had configured database backup and backup report text file , so backup was taken daily scuccessfully,and i want send email from server through i had execute the sql script for email alert, it was working fine,

i had execute the The following script
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'WJMN0130136',
@TO = N'',
@replyto = N'',
@CC = N'',
@BCC = N'',
@priority = N'NORMAL',
@subject = N' SQL Server Mail',
@message = N'Goodbye have a nice day, this is for test mail from MSSQL',
@messagefile = N'',
@type = N'text/plain',
@attachment = N'',
@attachments = N'',
@codepage = 0,
@server = N'servername'
select RC = @rc

i want script itself how to attach at @messagefile backup report text file automatically from particular disk path,

For example - @messagefile = N' C:\dbbackup\filename.txt', this file name has been changed daily whenever take backup. so i need send email the backup teport text file,

I want set the file name dynamic in @messagefile = N' C:\dbbackup\filename.txt'

Post #584653
Posted Monday, October 13, 2008 12:40 AM



Group: General Forum Members
Last Login: Saturday, December 3, 2016 5:18 AM
Points: 45,619, Visits: 44,147
Please don't post multiple threads with the same topic. It just wastes people's timeas they answer posts already answered. It also fragments replies and makes things harder to find

No replies to this thread please. Direct replies to:

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #584668
Posted Tuesday, October 14, 2008 12:31 PM


Group: General Forum Members
Last Login: Wednesday, December 16, 2015 12:14 AM
Points: 115, Visits: 649
For this I would recommend you to use SSIS package. You can easily create a SSIS package for this purpose.

Search in SQL server Central, you may get a package ready (depends on ur luck).

Its really easy to create these kind of packages in SSIS.

Its bit difficult to achieve this goal using only SQL SERVER
Post #585715
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse