dbTalk Databases Forums  

Script Job Hanging

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


Discuss Script Job Hanging in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nmlskl@i4free.co.nz
 
Posts: n/a

Default Script Job Hanging - 07-01-2005 , 04:28 AM






Please excuse me posting this in DTS, I am guessing someone in here has
experience with scheduling DTS tasks.
I am running SQL 2000 on a 2003 server and have a problem with a SQL
Job step not finishing.
The step is an activex script (see below) and as far as I can tell it
is to do with the ServerXMLHTTP section.
The problem is that the step never finishes. If I run the script on the
server directly all is good. Is it to do with the context the the job
is running in?
Any help would be appreciated, I just hope is is not a stupid error on
my part.

BTW, how do I raise an error from this script to fail the step (stop
later steps from trying to run)?

Dim url, xmlhttp, responseText
url = "http://address/filename.ext"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
Dim lResolve, lConnect, lSend, lReceive
lResolve = 5 * 1000
lConnect = 5 * 1000
lSend = 15 * 1000
lReceive = 15 * 1000
xmlhttp.setTimeouts lResolve, lConnect, lSend, lReceive
xmlhttp.open "GET", url, false
xmlhttp.send

If xmlhttp.Status >= 400 And xmlhttp.Status <= 599 Then
responseText = "Error Occurred : " & xmlhttp.Status & " - " &
xmlhttp.statusText
Else
responseText = xmlhttp.responseText
End If

set xmlhttp = nothing


Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("C:\Windows\Temp\UpdateFileList .csv",
True)
outFile.WriteLine(responseText)
outFile.Close

Set fso = nothing
Set outFile = nothing


Reply With Quote
  #2  
Old   
nmlskl@i4free.co.nz
 
Posts: n/a

Default Re: Script Job Hanging - 07-01-2005 , 07:53 AM






I am still interested any any ideas but a work around I found is to use
a command line step (instead of activex) to ececute the script manually
as follows

wscript C:\Windows\Temp\filename.ext


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.