Executing a DTS Package

  • Hello,

    I am trying to run a DTS Package from a stored procedure. But when I execute the procedure

    from the Query Analyzer, the procedure never completes. Here is the code for executing the

    DTS package.

    --create a package object

    EXEC @hr = sp_OACreate 'DTS.Package', @object OUTPUT

    if @hr <> 0

    BEGIN

    print 'error create DTS.Package'

    RETURN

    END

    EXEC @hr = sp_OAMethod @object, 'LoadFromSQLServer("myDB","","",256,,,, "OVCF")',

    NULL

    IF @hr <> 0

    BEGIN

    print 'error LoadFromStorageFile'

    RETURN

    END

    EXEC @hr = sp_OAMethod @object, 'Execute'

    IF @hr <> 0

    BEGIN

    print 'Execute failed'

    RETURN

    END

    If I comment out the last part (Execute of the object), the procedure runs fine. I need your help

    in figuring out what I need to do.

    Thanks

  • I still need help. Please.

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

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