July 30, 2007 at 2:07 am
Hi all,
Can you please send me code sample to dynamically assign file name - which I have to send as mail attachment.
vcFilePath is the variable declared in SSIS which store network path
vcFileName is the variable declared in SSIS which file name created and ready to be exported.
I am using below statement (I am using VB.Net), but is not working.
msg.Attachments.Add (vcFilePath & vcFileName)
It will be very helpful if anyone can help me out with code samples or any help in this direction.
Thanks in advance.
Mohan
July 30, 2007 at 2:50 am
Not sure why you are using VB. Why not use the send mail task? You can then use an expression to add the attachment.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
July 30, 2007 at 5:44 pm
I understand we can do the same in expressitions. Since I am also having other business rules implemented in VB.Net, I would like to do email attachment in Vb.Net itself. I appreciate if anyone can guide me through. Thanks in adance.
July 31, 2007 at 6:58 am
Mohan, in order to get or set global variables in SSIS you must first set those variables in the script task to be ReadOnly or ReadWrite Variables in the task options, then you would need to call the pipeline from the script. To use your example:
msg.Attachments.Add (Dts.Variables("vcFilePath").Value.ToString & Dts.Variables("vcFileName").Value.ToString)
Hope that helps.
jim
July 31, 2007 at 7:32 pm
Thanks for the help.
August 29, 2007 at 3:53 pm
Can anyone point me in the right direction to understand the syntax needed to work with expressions to allow dynamic attachments?
Thanks in advance
Troy
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply