Hi folks, can you all look this code over and let me know if its valid?
My concern is the <cftransaction> tags. I tried to make the DTS package fail on purpose (I just changed the DTS package name to one that doesn't exist), but the DELETE statement did not rollback.
I read on some sites that using <cftransaction> with <cftry>,<cfcatch> can be tricky.
Any suggestions?
____________________________________
Just Imagine.
Code:
<cftransaction>
<cftry>
<cfquery name="deletefirst" datasource="#DB#">
DELETE test2.dbo.myTable
FROM test2.dbo.myTable a inner join test1.dbo.myTable b ON a.myTable_ID = b.myTable_ID
WHERE b.is_Live = 1
</cfquery>
<cfquery name="my_DTS" datasource="#DB#">exec master..xp_cmdshell 'dtsrun.exe /S abcde /E /N my_DTS'</cfquery>
<cfcatch type="Database">
<cfmail from="" to="" subject="Error pushing DTS package for <cfoutput>#CGI.SCRIPT_NAME#</cfoutput>" type="html">
SOME TEXT
</cfmail>
<cflocation url="somelink.cfm" addtoken="no">
</cfcatch>
</cftry>
<cftransaction>
My concern is the <cftransaction> tags. I tried to make the DTS package fail on purpose (I just changed the DTS package name to one that doesn't exist), but the DELETE statement did not rollback.
I read on some sites that using <cftransaction> with <cftry>,<cfcatch> can be tricky.
Any suggestions?
____________________________________
Just Imagine.