dbTalk Databases Forums  

Write to Application Log From DTS

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


Discuss Write to Application Log From DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Payne
 
Posts: n/a

Default Write to Application Log From DTS - 01-13-2005 , 10:35 AM






Hi,

Is it possible to write to the application log from within a script in an
ActiveX task? It's pretty easy to do with a custom task in VB, and there's
also an undocumented system stored procedure that let's you do it (although
you need to be running under high priveledge to use it), but is there an
easy way to accomplish this in ActiveX Scripts? I'm guessing probably not,
but thought I'd ask! Basically I'm thinking of logging some additional
information to the application log if certain events occur during the
execution of the package, and am trying to see what the options that are
available are.



Tim.



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Write to Application Log From DTS - 01-13-2005 , 12:25 PM






In message <OW0Pf3Y#EHA.608 (AT) TK2MSFTNGP15 (DOT) phx.gbl>, Tim Payne
<tim (AT) branded3 (DOT) com> writes
Quote:
Hi,

Is it possible to write to the application log from within a script in an
ActiveX task? It's pretty easy to do with a custom task in VB, and there's
also an undocumented system stored procedure that let's you do it (although
you need to be running under high priveledge to use it), but is there an
easy way to accomplish this in ActiveX Scripts? I'm guessing probably not,
but thought I'd ask! Basically I'm thinking of logging some additional
information to the application log if certain events occur during the
execution of the package, and am trying to see what the options that are
available are.



Tim.



Yes, see sample below-

Const EventTypeInfo = 4
Dim oWshShell

Set oWshShell = CreateObject("WScript.Shell")
oWshShell.LogEvent EventTypeInfo, m_sBuffer
Set oWshShell = Nothing

You can also write to the DTS package log, -

DTSPackageLog.WriteWriteStringToLog "Fred"
or

DTSPackageLog.WriteTaskRecord 1, "Fred"


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.