DTS Script Error

  • Hi ,

    The following DTS Active Script works fine in SQL server 7.0. But the same fails to run in sql 2000. I am trying to write to NT event log in the code. It gives activex component can't create object in NT box. Can anyone help me how to write a Log in NT Eventlog.

    Function Main()

    dim objNTLog

    set objNTLog = createobject("ntEventLog.Writer")

    objNTLog.logNTEvent "tCustomer Insert failed.", "tCustomer Insert Failed", 1, 1000

    'Delete Header, & Load data

    Main = DTSTaskExecResult_Success

    End Function

    Thanks

  • there is a wscript event that writes to the application event log.

    set wshShell = createObject("wscript.shell")

    WshShell.LogEvent 0, "The following process was killed programatically "

    This works in VBS for me it should work in DTS.

    Bruce

    Bruce Szabo, MCSE+I, MCDBA, MCSD


    Bruce Szabo, MCSE+I, MCDBA, MCSD

  • If you don't have to use ActiveX Script then the following SQL will make an entry in the NT Eventlog:

    raiserror ('customer insert failed', 1,1) WITH LOG

    Robert Marda

    SQL Server will deliver its data any way you want it

    when you give your SQL Programmer enough developing time.

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply