dbTalk Databases Forums  

Job Fail

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Job Fail in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sardinka
 
Posts: n/a

Default Job Fail - 08-22-2003 , 08:28 AM






I have the following code where I am chechking the age of
the file. If file more then 24 hours then
DTSTaskExecResult_Failure.
In a job it stated - fail but in reality it is not. How do
I hadle this situation?
Function Main()
Dim fso, f, fc, f1, PName, FName
Set fso=CreateObject("Scripting.FileSystemObject")
rootDir="C:\"
If (fso.FileExists (rootDir & "\HW.TXT")= True) Then
Set File = fso.GetFile(rootDir & "\HW.TXT")
' Check age of file is less than 24 hours
If DateDiff("h", File.DateLastModified, Now ) <= 24 Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End if
Else
Main = DTSTaskExecResult_Failure
end if
Set fso = Nothing
End Function


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Job Fail - 08-22-2003 , 09:18 AM






You do not really want to fail your package rather you want to exit
gracefully. Workflow meets this requirement.

Multiple Paths in Workflow
http://www.sqldts.com/default.aspx?6,103,218,7,1

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.