This content has been marked as final. Show 7 replies
> i was wondering if i could do somethig sql side of things? i am using sql
> express 2008
I do not know explicitly for SQL Express 2008, but yes many modern
Database Management Systems have the ability to out XML directly. I am
sure it would be worth checking with some SQL Express 2008 documentation
or resources to see if it is one.
Hi is there a better way to handle this task?
basically what i need is this
1. if there are any entries in the table send out an xml file to a url
2. then delete the current row
10,000 records takes a long time, i need to speed this process up somehow?
Can you post your code, including database structure if applicable?
Hi yes my code is simple, there is more content in the xml but dont think its required for this
<cfset strURL = (" http://www.url.com") />
<cfhttp url="#strURL#" method="POST" useragent="#CGI.http_user_agent#" result="objGet">
<cfhttpparam type="XML" value="#strXML.Trim()#" />
<!--- DELETE CURRENT MESSAGE FROM TABLE--->
<cfstoredproc procedure="sp_DeleteXML" datasource="#application.ds#">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="MessID" value="#qGetMessages.ID#" null="No">
Is it possible to batch all the query results into a single XML document to be posted? This could be an improvement over 10k records being looped over.
Many thanks for your reply, yes i could do that, but i would need to resolve my other post first, checking if the scheduled task is already being run, as if i do as you surgested, and another schedule starts this could cause duplictes being sent.
A couple of ideas to avoid overlapping the execution of your scheduled tasks. Note that I haven't tested any of these ideas.
1. Reset the schedule every time the task is run. The first action of the scheduled task is to set it's interval to daily and start time to 6 hours in the future. The last action of the scheduled task is to reset the schedule to the normal value.
2. Use an application scope variable. The first action of the task is to check a variable Application.IsMyTaskRunning. If the value is defined and true this means the task is already being executed so no work is done and the task is finished. If the value undefined or false the task sets the value to true then runs normally. On completion the value is set to false.