Delaying a procedure for an external script

  • The dilemma I have is that I have a multiple step operation to import a zip file, rip the contents from Excel 2007 into SQL 2000, inventory and resize a slew of images, and then rebuild 3 tables. This is occuring within a Classic Asp web application

    I have everything staged so that the inventory (via file system object) is done as early as possible and the script does not move onto the next procedure until that is completed.

    A second script is initiated via an iframe which then validates that I have the correct images and reduces their size and relocates them into the correct directory.

    In the meantime, I have another 4 procedures occurring to take care of the rest of the data and get that ready to go.

    This works out fine when I only have a handful of images to deal with, but Sql is getting ahead when it comes to dozens naturally. And I need to wait for the images to finish because that operation is updating my data tables to mark that images are valid.

    My current train of thought is to have that image processing script to set a flag that I can read via tsql inside of a procedure and then use a WHILE loop with a WAITFOR and then read the flag to see if its done.

    I have also considered having that external script execute the finish of the processes

    So i am looking for any thoughts or suggestions from the experts on what would be the best thing to do

    Director of Transmogrification Services
  • That should work fine. You also could have the ASP kick off a job when it's done, and have that job run the T-SQL, or even move this to SSIS and kick off a package to manage the whole thing.

    However setting a flag in a table, can work just fine. Make sure you account for failures and restarts in the middle of either process (ASP or SQL) and have a way for them to pick up at the proper step.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply