Dependency between SQL Tasks in DTS

  • I need to set up a dependency for an asynchronous operation.

    In my DTS package, I have 2 SQL Tasks (Task_A & Task_B). 

    Task_A executes Stored_Proc_X.  This proc invokes 15 BCP's via xp_cmdshell. 

    The proc uses a cursor to loop thru and initiate 15 BCP's.   The proc initiates these in 1 second and completes -- relinquishing the BCP Out workload to the O/S.  (Note: the BCP's are copying 30 GB of SQL table data to .DAT files)

    DTS then initiates SQL TASK_B almost immediately.  Task_B is dependant on the full compliment of data being

    resident in the .DAT files.   Of course, this is not happening.

    Is there a mechanism I can apply to TASK_A, Task_B, or inbetween Task_A & B --- to make Task_B WAIT

    until Task_A is complete at the O/S level? 

    (I'm familiar with the command:  WAITFOR DELAY '00:01:00'  but I'd prefer to avoid the use if this as I do not know the duration of the BCP's from

    day to day)

     

    BT
  • This article has a function and examples of how to check for file status, you could modify the checking script and put that into an additional sql task and have that loop untill all the files have been bcped out.

     

    http://www.databasejournal.com/features/mssql/article.php/10894_3492046_1

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

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