dbTalk Databases Forums  

Writing package log

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Writing package log in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Blake Anderson
 
Posts: n/a

Default Writing package log - 05-13-2004 , 12:21 PM






I'm using the following code in an ActiveX Script Task to write to the package log for a DTS package

Function Main(
DTSPackageLog.WriteStringToLog "Hey, what's this?
Main = DTSTaskExecResult_Succes
End Functio

When I look at the log after execution, my message shows up in the Task Detail, but the Status column has a big red "X" and the Error Code column says "Failed." I've poked around on BOL and MSDN to see if there's something I'm missing, but I can't seem to figure out how to make it look like it's just a status message, and not some sort of failure

Am I missing something? Or is that just the way it works?

Reply With Quote
  #2  
Old   
Phill Carter
 
Posts: n/a

Default Re: Writing package log - 05-16-2004 , 11:36 PM






Use WriteTaskRecord instead. This allows you to pass an error code. A zero
or negative number will log a failure type message, postive number will log
a success type message.


"Blake Anderson" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I'm using the following code in an ActiveX Script Task to write to the
package log for a DTS package:

Function Main()
DTSPackageLog.WriteStringToLog "Hey, what's this?"
Main = DTSTaskExecResult_Success
End Function

When I look at the log after execution, my message shows up in the Task
Detail, but the Status column has a big red "X" and the Error Code column
says "Failed." I've poked around on BOL and MSDN to see if there's
something I'm missing, but I can't seem to figure out how to make it look
like it's just a status message, and not some sort of failure.
Quote:
Am I missing something? Or is that just the way it works?



Reply With Quote
  #3  
Old   
Alexei Akimov
 
Posts: n/a

Default Re: Writing package log - 05-20-2004 , 04:29 PM



Quote:
Am I missing something? Or is that just the way it works?
Yes, Something WRONG with instantiation of DTSPackageLog.
It does not always instantiate on the first try (inside ActiveX
script) -
even in identical conditions.

MS never write clearly how to instantiate it. They just copy and paste
this
phrase (looks like they are describing inner mechanics of
implementation
of the object, which has nothing to do with application programmer
work):

Quote:
Use the PackageLog object methods when custom tasks and the
ActiveScriptTask object are to write task log records.
A reference to PackageLog is passed as a parameter of the task
Execute method.
In task ActiveX scripts, it is available as the DTSPackageLog
scripting object.

Alexei Akimov


"Phill Carter" <pcarter (AT) bellpotter (DOT) com.au> wrote

Quote:
Use WriteTaskRecord instead. This allows you to pass an error code. A zero
or negative number will log a failure type message, postive number will log
a success type message.


"Blake Anderson" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:837EB65B-426F-40F0-AAD8-133C7F10638D (AT) microsoft (DOT) com...
I'm using the following code in an ActiveX Script Task to write to the
package log for a DTS package:

Function Main()
DTSPackageLog.WriteStringToLog "Hey, what's this?"
Main = DTSTaskExecResult_Success
End Function

When I look at the log after execution, my message shows up in the Task
Detail, but the Status column has a big red "X" and the Error Code column
says "Failed." I've poked around on BOL and MSDN to see if there's
something I'm missing, but I can't seem to figure out how to make it look
like it's just a status message, and not some sort of failure.

Am I missing something? Or is that just the way it works?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.