Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 creating email attachment from backup job in sql a

Author  Topic 

cgijag
Starting Member

1 Post

Posted - 2009-11-16 : 09:50:58
Hello,
we've upgraded from SQL 2000 to 2005. In 2000 our Database Maintence plan would backup our DB's and email the job log as an attchment to our admin group. In 2005 we have the maint plans recreated and it emails but can't figure out how to attach the job log. I've read about the the different attach commands but Since the log filename is the job name+timedate of when its executed and not static i'm not sure if thats the way to address this issue. We need this for our SOX compliance. Thanks.

ajitgadge
Starting Member

12 Posts

Posted - 2009-12-22 : 08:07:53
I would suggest to use dynamic sql to create the filename and filepath which you want to attach and send after backup. You can use sendmail or database mail in sql 2005 as command line to create the script. Or still you are not matching the filename then you can use filename masking with xp_cmdshell 'dir /B @filepath + @filemasking ' to get the file name.

Hope this will help you.
Go to Top of Page
   

- Advertisement -