all groups > sql server dts > january 2005 >
You're in the

sql server dts

group:

Write to Application Log From DTS


Write to Application Log From DTS Tim Payne
1/13/2005 4:35:17 PM
sql server dts:
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.

Re: Write to Application Log From DTS Darren Green
1/13/2005 6:25:27 PM
In message <OW0Pf3Y#EHA.608@TK2MSFTNGP15.phx.gbl>, Tim Payne
<tim@branded3.com> writes
[quoted text, click to view]


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
AddThis Social Bookmark Button