Groups | Blog | Home
all groups > sql server dts > august 2006 >

sql server dts : dts package sometimes stops executing



ilske
8/7/2006 4:45:15 AM
I got the following sequence of tasks in my dts package :

.... -> Script Task
-SUCCESS-> Task 1 -> Task 2 -> Task 3 -> ...
-FAILURE-> Task 3

So, if the script task succeeds, tasks 1, 2 and 3 are executed. If it
fails, only task 3 is executed.
The package is executed from within an other parent package. When
starting the parent package, most of the time everything works fine,
but sometimes the child package stops at step "Script task" for no
reason. When executing the parent package again afterwards, everything
words fine again !

The Script Task looks like this :

Function Main()

Dim opkg, oConstraint, oConstraints
Const DTSPath_True_Last_Step = "<Task 2>"
Const Current_Step = "<Script Task>"

Set fso = CreateObject("Scripting.FileSystemObject")
Set oPkg = DTSGlobalVariables.Parent
Set oConstraints = oPkg.Steps("<Task 3>").PrecedenceConstraints

If fso.FileExists(DTSGlobalVariables("filename").Value) Then
Set file1 =fso.getfile(DTSGlobalVariables("filename").Value)
If (file1.Size) > 0 Then
oPkg.Steps(Current_Step).DisableStep = True
Set oConstraint = GetConstraint(oConstraints, DTSPath_True_Last_Step)
oConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
oConstraint.Value = DTSStepExecResult_Success
Set oConstraint = GetConstraint(oConstraints, Current_Step)
oConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecStatus
oConstraint.Value = DTSStepExecStat_Inactive
oPkg.Steps(Current_Step).ExecutionStatus = DTSStepExecStat_Inactive
Main =DTSTaskExecResult_Success
Exit Function
End If
End If

Set oConstraint = GetConstraint(oConstraints, Current_Step)
oConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
oConstraint.Value = DTSStepExecResult_Failure
Set oConstraint = GetConstraint(oConstraints, DTSPath_True_Last_Step)
oConstraint.PrecedenceBasis = DTSStepPrecedenceBasis_ExecStatus
oConstraint.Value = DTSStepExecStat_Inactive
oPkg.Steps(DTSPath_True_Last_Step).ExecutionStatus =
DTSStepExecStat_Inactive
Main = DTSTaskExecResult_Failure

End Function

Function GetConstraint(oConstraints, sStepName)
' Get Constraint by Source Step Name
Dim oConstraint
For Each oConstraint In oConstraints
If oConstraint.StepName = sStepName Then
Set GetConstraint = oConstraint
Exit For
End If
Next
End Function

When executing the package, the file exists, so the task should report
success.

Can anyone please help me ?
Thanks in advance !
Allan Mitchell
8/7/2006 6:43:37 PM
Without an error message it is difficult (Does it error or just stop?)

Anyway the first thing I would be trying to set everything to execute on the
main package thread. (Workflow Properties)

--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



[quoted text, click to view]

ilske
8/8/2006 6:38:24 AM
It gets even worse now :

I have set indicator 'execute on main package thread' for all steps in
the package and in the parent package. When I execute the parent
package, the package stops after Task 2 (see my example), and the
parent package gives error message "the executable program that this
service is configured to run in does not implement the service". When
executing the package itself, it also stops after Task 2, without
giving any error message. In the log is mentioned that the package
execution succeeded.


Allan Mitchell schreef:

[quoted text, click to view]
Allan Mitchell
8/8/2006 7:14:10 PM
Do any of these help

http://www.google.com/search?hl=en&lr=&rls=GGLD%2CGGLD%3A2005-41%2CGGLD%3Aen&q=%22configured+to+run+in+does+not+implement+the+service%22

--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



[quoted text, click to view]

AddThis Social Bookmark Button