SSIS Logging
Hi,
I have migrated DTS package into SSIS. One of theActiveX Script contains the following code. I have a question regarding changing this code.
What is the equilaent object of reading LogFileName in SSIS? I setup the Logging in SSIS, but didn't fidn any option using which i can refer to logfile as it is done in the following DTS code.
It'll be a great help if somebody can assist me in this.
Thanks in advance.
Neetu
Code:
Function Main()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
dim fso
dim pkg
dim filename
dim srcfile, logfile
dim inchar
set fso = CreateObject("Scripting.FileSystemObject")
set pkg = DTSGlobalVariables.parent
set logfile = fso.OpenTextFile(DTSGlobalVariables.parent.Properties("LogFileName").Value, ForAppending, True)
filename = Pkg.Connections("CARSBalance").Properties("DataSource").Value
If (fso.FileExists(filename)) Then
set srcfile = fso.OpenTextFile(filename, ForAppending)
' Add a blank character to the file.
srcfile.Write " "
srcfile.Close
set srcfile = fso.OpenTextFile(filename, ForReading)
'Read a line from the source file
inchar = srcfile.Readline
If Len(inchar) <= 1 then
'Have to close the file, then open ForWriting
srcfile.Close
logfile.WriteLine ("File is empty: " & filename)
logfile.WriteLine ("Adding dummy record")
set srcfile = fso.OpenTextFile(filename, ForWriting)
srcfile.WriteLine(" ")
End If
Main = DTSTaskExecResult_Success
srcfile.Close
Else
logfile.WriteLine
logfile.WriteLine ("$$$$$$$$$$$$$ File does not exist: " + filename + " $$$$$$$$$$$$$")
logfile.WriteLine
SuccessReturncode = -1
Main = DTSTaskExecResult_Failure
End If
logfile.Close
End Function
December 15th, 2006 9:54pm
Sorry!
I am changing my question. The question is given below.
I have migrated a DTS pakage into SSIS. The DTS package validates a Textfile Source File using an ActiveX Script task.
Could somebody tell me how to validate a FlatFilein SSIS. Based on whether the file exist or if exist then whether its empty or not, I have to execute adatabase proc.
It'll be very helpful if somebody can assist me in this.
Thanks in advance.
Neetu
Free Windows Admin Tool Kit Click here and download it now
December 16th, 2006 2:16am
See this Article.
http://pragmaticworks.com/Products/Business-Intelligence/BIxPress/ssis-logging-auditing-monitoring.aspx
SSIS-Tutorials-FAQs |
Convert DTS to SSIS |
Document SSIS |
SSIS Tasks |
Real-time SSIS Monitoring
May 2nd, 2011 1:02pm