?
Solved

Know if a DTS has finished or not?

Posted on 2005-05-04
10
Medium Priority
?
232 Views
Last Modified: 2013-11-30
Is that possible? I have a page that executes  a DTs with the referenced DLL. but it takes long time.

Is there a way to know if a DTS has finished or not?
0
Comment
Question by:djhex
  • 4
  • 3
7 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 13926801
"Is that possible? I have a page that executes  a DTs with the referenced DLL. but it takes long time.:"

How are you executing it?
0
 
LVL 10

Author Comment

by:djhex
ID: 13926822
With the referenced DLL.

DTS.DLL

from the sql server folder.

0
 
LVL 34

Expert Comment

by:arbert
ID: 13926915
So how are you executing it "from your page"?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 10

Author Comment

by:djhex
ID: 13927083
  Private Sub btnenviar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnenviar.Click
        Try
            Server.ScriptTimeout = 3600
            objactualizar.actualizarSemiElaborados(fechadesde.SelectedDate, fechahasta.SelectedDate, txtdiassemi.Text)
            Dim fecha As String = DateTime.Now.Year & "_" & DateTime.Now.Month & "_" & DateTime.Now.Day & "_" & DateTime.Now.Hour & "_" & DateTime.Now.Minute & "_" & Session("Username")
            objexecsp.cambiarnombretablaSemiElaborados(fecha)
            objexecsp.borrarexistenciassemi()
             objexecsp.ejecuta_SP_EXISTENCIASR()  --> DTS
             lblmensajes.Text = "Proceso generado satisfactoriamente"
        Catch ex As Exception
            lblmensajes.Text = ex.Message
        End Try
    End Sub


  Public Function ejecuta_SP_EXISTENCIASR()
        ' call UpdatePrice using a parameter array of SqlParameter objects
        Try
            Dim ejecutardts As New cDTS
            ejecutardts.EjecutarDTS("TransferirDatos(ExistR)")
        Catch ex As Exception
            Throw ex
        End Try
    End Function


  Public Sub EjecutarDTS(ByVal NombreDTS As String)

        Dim pkg As New DTS.Package
        Dim oStep As DTS.Step
        Try
            pkg = New DTS.Package
            pkg.LoadFromSQLServer("MED20NT", "sa", "prueva", DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, "", "", "", NombreDTS, "")
            pkg.AutoCommitTransaction = True
            pkg.Execute()

            For Each oStep In pkg.Steps
                If oStep.ExecutionResult = DTSStepExecResult.DTSStepExecResult_Failure Then
                    Throw New Exception("Error al procesar DTS " & pkg.Name & " en el paso " & oStep.Name)
                End If
            Next
        Catch ex As System.Runtime.InteropServices.COMException
            Throw ex
        Catch ex As Exception
            Throw ex
        Finally
            pkg.UnInitialize()
            pkg = Nothing
        End Try
    End Sub

0
 
LVL 34

Expert Comment

by:arbert
ID: 13927155
The .Execute method is a "blocking" process.  It should wait until it's done executing.  What exactly are you trying to do?
0
 
LVL 10

Author Comment

by:djhex
ID: 13927234
execute a long dts from my page.

I want to make a WAITING page. I think that it may exist a system table that tell me if there was some dts running so I could check for a column every second

but I think is not possible.

The reason for the question is that the dts begins execution and it takes about 2 or 3 minutes executing and the page seems to make nothing.

0
 
LVL 34

Accepted Solution

by:
arbert earned 2000 total points
ID: 13932093
"The reason for the question is that the dts begins execution and it takes about 2 or 3 minutes executing and the page seems to make nothing."

Yes, like I said above, if you use .Execute from your page, it's a non-yielding task.  You would have to call a job or us a different method, by using Execute, the page is going to wait until it's done...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question