-
sp_send_dbmail
I have a maintenance plan which put out a report everyday after if runs, with the name as PlainMMDDYYYY. Using sp_send_dbmail, how can one have the report sent to the operator when the new file each day? I have at the end of the plan an Excute T-SQL Statement task which exec sp_db_mail but using the @file_attachment won't get the newly name file each day
-
You can write T-SQL script to get file name, try using xp_cmdshell 'dir /b' to get the name. Use INSERT statement to put the output of xp_cmdshell into a table then you can use that to generate @file_attachment.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|