SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database maintenance plan


Database maintenance plan

Author
Message
SQL Galaxy
SQL Galaxy
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3387 Visits: 3485
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 SMTP.so 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',
@FROM_NAME = N'JG-IDC-SQL Server',
@TO = N'ananda.murugesan@zmail.ril.com',
@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
go

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'

Thanks
GilaMonster
GilaMonster
SSC Guru
SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)SSC Guru (118K reputation)

Group: General Forum Members
Points: 118654 Visits: 45547
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:
http://www.sqlservercentral.com/Forums/Topic584368-5-1.aspx

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


brainy
brainy
Old Hand
Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)Old Hand (355 reputation)

Group: General Forum Members
Points: 355 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search