Solved

SSIS : Send Mail Task Error: File doesn't exist or you don't have permission.

Posted on 2016-07-26
6
42 Views
Last Modified: 2016-10-28
I was trying to attach LOG files in send mail task. I have multiple log files to attach. When I use direct path to attach file, It works but when I use variable, it's giving me error. I am using following expression with user variable. I also set Delay Validation = True.

@Log_File_Attachment: "\\\\ServerName\\Drive$\\Folder 1\\Folder 2\\Folder 3\\*.log"

Please correct me where I am mistaking.
0
Comment
Question by:Member_2_7969381
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 41730172
Instead of #.log, have you tried one specific file?

@Log_File_Attachment: "\\\\ServerName\\Drive$\\Folder 1\\Folder 2\\Folder 3\\MyLog.log"
0
 
LVL 6

Expert Comment

by:Manju
ID: 41733183
Click on the expressions tab (on the left of the Send Mail task editor) and expand/click on the ellipsis on the Expressions box on the right.  Select the "FileAttachments" property and type in @[User::filename] into the Expression box.
0
 

Accepted Solution

by:
Member_2_7969381 earned 0 total points
ID: 41733708
Created 2 variables : Log_File & Log_Files

I completed this task by adding Script task with below command line.

Dts.Variables["User::Log_Files"].Value = Dts.Variables["User::Log_Files"].Value.ToString() + "|" + Dts.Variables["User::Log_File"].Value.ToString();

Thanks
0
 
LVL 43

Expert Comment

by:zephyr_hex (Megan)
ID: 41811665
If you resolved the problem, you can close out the thread and select your own post as the solution.
0
 

Author Comment

by:Member_2_7969381
ID: 41863838
Thanks to all
0

Featured Post

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server Trigger 8 37
removing unwanted rows from an sql server ranked table 13 36
SQL eating up memory? 16 41
Need to trim my database size 9 26
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question