Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Posts
    1

    Unanswered: Problem with executing a SQL Server DTS Package from ASP

    Could someone help. I am new at writing scripts to execute a DTS package using ASP. After I run my scripts, I get the following error message :

    Step [DTSStep_DTSDataPumpTask_1] failed
    Task "Import FITA Calendar"

    Package [Import Fita Calendar] failed

    Here is what my scripts look like :

    <%
    Const DTSSQLStgFlag_Default = 0
    Const DTSStepExecResult_Failure = 1

    Dim oPkg, oStep, sMessage, bStatus

    Set oPkg = Server.CreateObject("DTS.Package")
    oPkg.LoadFromSQLServer "myserver","sa","$12eww",DTSSQLStgFlag_Default,"", "","","Import FITA calendar"
    oPkg.Execute()

    bStatus = True

    For Each oStep In oPkg.Steps
    sMessage = sMessage & "<p> Step [" & oStep.Name & "] "
    If oStep.ExecutionResult = DTSStepExecResult_Failure Then
    sMessage = sMessage & " failed<br>"
    bStatus = False
    Else
    sMessage = sMessage & " succeeded<br>"
    End If
    sMessage = sMessage & "Task """ & oPkg.Tasks (oStep.TaskName).Description & """</p>"
    Next

    If bStatus Then
    sMessage = sMessage & "<p>Package [" & oPkg.Name & "] succeeded</p>"
    Else
    sMessage = sMessage & "<p>Package [" & oPkg.Name & "] failed</p>"
    End If

    Response.Write sMessage
    Response.Write "<p>Done</p>"

    %>

  2. #2
    Join Date
    Oct 2003
    Location
    Dallas
    Posts
    76

    well do you know how to exec sp in asp

    because I do that alot. And you can exec DTS inside SP. So you can place this inside your sp and just exec from asp. Hope that helps.

    example

    exec master..xp_cmdshell 'dtsrun /Ssql1 /NPublish /E'
    This will execute the DTSRun command line utility with the parameters

    /S = SQL Server Host Name
    /N = DTS Package Name
    You can either use /E for "trusted connection" or /U/P to supply username and passwords

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •