Sunday, March 11, 2012

Assigning Filepath to Global Variable in DTS

How can I assign file path to a DTS Global Variable in an activex script.

i hope u know how to create global variable in DTS. Here we have two global variable DestinationPath and SourcePath and see how its been used in VBScript

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Function Main()
Main = DTSTaskExecResult_Success

sSourceFile1 =dtsglobalvariables("DestinationPath").value
sSourceFile2 = dtsglobalvariables("SourcePath").value

set fso = CreateObject("Scripting.FileSystemObject")
fso.deletefile sSourceFile1
fso.copyfile sSourceFile2, sSourceFile1

End Function

http://www.sqldts.com is one of the best resource in DTS

Madhu

|||

Now that I have assigned a filepath to a global variable and is a dynamic one, since the file that is created is done on a daily basis and each file has a datetime stamp, i have figured out that already, but now i am facing trouble assigning the dynamic path that i have assigned in global variable to the Send Mail Task in DTS, can you help me with this issue.

|||

Consult http://msdn2.microsoft.com/en-us/library/ms141698.aspx for how to create a property expression on your send mail task.

You are just about there!

jkh

No comments:

Post a Comment