![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dear NGroup, I want my package to wait for certain files to show up in the folder before it could start executing the data transfer?? I have large number of sources (more than 150 or so) sending their data to me. My job is to absorb all the data from these sources into my DB. The transfer from these sources is not guaranteed until all the text files show up in the folder assigned to that source. While this is happening I want to kick-off my DTS and go home. I want this package to keep waiting for all the files show up in any one of the folders scheduled for that day. Start the data import just for that folder and wait for another source to finish the transfer and import that data later and so on. I cannot control the way each source is transferring their data. They want to send at their own time during the day. And we cannot handle more 15 transfers in a day. But it is virtually impossible for me wait for them to finish 1 by 1 to kick-off my job for each one of them separately. Hope all this makes sense to anyone? I am pretty close to it but not getting something to work. Thanks Sachy. |
#3
| |||
| |||
|
|
My VB example was before the days of .Net. In .Net i would use the FileSystemWatcher class to do the waiting and fire the events to call my package. |
#4
| |||
| |||
|
|
In article <OjHghJeyDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Allan Mitchell allan (AT) no-spam (DOT) sqldts.com> writes snip My VB example was before the days of .Net. In .Net i would use the FileSystemWatcher class to do the waiting and fire the events to call my package. Even before .net this was possible, using the FindFirstChangeNotification and related API calls. Here is a VB implementation sample- http://www.mvps.org/vbnet/code/filea...chedfolder.htm -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org |
#5
| |||
| |||
|
|
-----Original Message----- In article <OjHghJeyDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Allan Mitchell allan (AT) no-spam (DOT) sqldts.com> writes snip My VB example was before the days of .Net. In .Net i would use the FileSystemWatcher class to do the waiting and fire the events to call my package. Even before .net this was possible, using the FindFirstChangeNotification and related API calls. Here is a VB implementation sample- http://www.mvps.org/vbnet/code/filea...chedfolder.htm -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org . |
#6
| |||
| |||
|
|
Thanks Darren, I didnt know about this. I will try this one somewhere. But in the mean time here is an alternative option. Well I got something to work using VBscript WScript.sleep. This way I stay in my DTS ActiveXScript. Here is what I did. It is working but needs some more final touch up and testing. 1. A Job is schedule to kick-off DTS. 2. DTS package starts with checking Today's schedule from SQL Table. Reads all the respective directory path from the table. 3. Upon knowing all the directories, it checks 1 by 1 all of them for existence of all the files. 4. If all files not found in any of the directories, CALL WscShell.Run("Sleep.vbs", True) where Sleep.vbs has only one line, WScript.sleep 10000. 5. After 10 seconds, it loops through again. 6. Finds all the files for any one folder, continues with importing data. 7. Imports the data from folder which has all the files in it. 8. Marks the status and continue to work on remaining. Does this makes sense or you find any flaw in here. I didnt have much time to finish this but if i get opportunity, i will try your way. Thanks to both of you, Sachy -----Original Message----- In article <OjHghJeyDHA.2308 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, Allan Mitchell allan (AT) no-spam (DOT) sqldts.com> writes snip My VB example was before the days of .Net. In .Net i would use the FileSystemWatcher class to do the waiting and fire the events to call my package. Even before .net this was possible, using the FindFirstChangeNotification and related API calls. Here is a VB implementation sample- http://www.mvps.org/vbnet/code/filea...chedfolder.htm -- Darren Green (SQL Server MVP) DTS - http://www.sqldts.com PASS - the definitive, global community for SQL Server professionals http://www.sqlpass.org . |
#7
| |||
| |||
|
|
Thanks Darren, I didnt know about this. I will try this one somewhere. But in the mean time here is an alternative option. Well I got something to work using VBscript WScript.sleep. This way I stay in my DTS ActiveXScript. Here is what I did. It is working but needs some more final touch up and testing. 1. A Job is schedule to kick-off DTS. 2. DTS package starts with checking Today's schedule from SQL Table. Reads all the respective directory path from the table. 3. Upon knowing all the directories, it checks 1 by 1 all of them for existence of all the files. 4. If all files not found in any of the directories, CALL WscShell.Run("Sleep.vbs", True) where Sleep.vbs has only one line, WScript.sleep 10000. 5. After 10 seconds, it loops through again. 6. Finds all the files for any one folder, continues with importing data. 7. Imports the data from folder which has all the files in it. 8. Marks the status and continue to work on remaining. Does this makes sense or you find any flaw in here. I didnt have much time to finish this but if i get opportunity, i will try your way. Thanks to both of you, Sachy |
![]() |
| Thread Tools | |
| Display Modes | |
| |