DTS & Trigger -
02-27-2006
, 08:11 AM
Our web app enables users to upload a txt file that includes records for
financial transactions (one record = one transaction). All the parsing of
the txt file and db writes was done w/ASP and stored procedures. Problem is,
if a file contains more than a few thousand records it's a slow.
So...I decided to instead call a DTS package from an sp. The DTS reads the
contents of the txt file and dumps the records into a table (File_Upload).
Upon completion of the DTS, the user would then receive confirmation that the
file had been uploaded. As far as the user is concerned, I want to indicate
that processing is complete.
Now additional processing needs to be performed at this point, so I decided
I would place a trigger on File_Upload (which then calls another stored
proc), thinking this would be a seperate process. This is not the case,
because if I force an error on the trigger, the Package Log for DTS logs an
error. I don't want this processing to be included in the same
transaction/process as the DTS package itself as this defeats the purpose of
providing a quicker user experience. Here's an outline of how I've
progressed thus far:
1) ASP page calls 'sp_DTS_File' (stored proc.)
2) sp_DTS_File then executes DTS using sp_OACreate.
Contents of txt file dumped into File_Upload (table).
4) Insert trigger on File_Upload table calls sp_Process_File which populates
data into normailized tables. This is the step that I want to be
'transparent' to the user. This is not the case though.
Any help is greatly appreciated. |