August 9, 2006 at 7:21 am
this dts package is a vb script which will send you a list
of all failed jobs across your servers. it produces an
html file for you.
it's really just a vb script which you incorporate into dts.
i'm having some trouble with it, and I was wondering if it's
possible to convert this over to a job which will produce the
same html file some where in a folder.
here is the script.
thoughts?
This is the script. The XML file follows.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Dim xmlServers
Function Main()
' Read in the server list
InitServers
' Get the job status and write the web page
GetJobStatus
Main = DTSTaskExecResult_Success
End Function
Sub GetJobStatus()
Dim xmlServer
Dim ServerName
Dim ConnectionString
Dim cn
Dim rs
Dim SQL
Dim JobName
Dim ErrorMessage
Dim RunDate
Dim RunTime
Dim OK
Dim fso
Dim ts
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("\\DBAWEB01\SQL$\SQLJobStatus.htm", 2,-1)
Set cn = CreateObject("ADODB.Connection")
' If this is monday, the include the whole weekend
RunDate = Now()
if DatePart( "w", RunDate ) = 2 then
RunDate = DateAdd("d",-3,RunDate)
else
RunDate = DateAdd("d",-1,RunDate)
end if
ts.WriteLine "
" & _"
""
ts.WriteLine "
" & _"
" & _
"
" & _
"
" & _
"
Server | Job Name | Message | Failure Date |
---|---|---|---|
" & ServerName & " | |||
" & ServerName & " | " & JobName & _ " | " & ErrorMessage & _ " | " & FormatDateTime(RunDate,vbshortdate) & _ " " & FormatDateTime(RunTime, vbShortTime) & " | Unable to connect:" & Err.Description & " |
"
ts.Close
Set ts = Nothing
Set fso = Nothing
End Sub
Sub InitServers()
set xmlServers = createObject("MSXML.DOMDocument")
xmlServers.Load "\\DEVSQL01\dts\dba\SQLServerJobs.ini"
End Sub
This is the XML configuration file (SQLServerJobs.ini):
_________________________
August 10, 2006 at 8:33 pm
you incorporated ActiveX in DTS package. Can't you just pass it in the job as:
DTSRUN /N"ReadFailedJobDTS" /E /SYourServer
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply