Suggestion needed for a long import process
I am about to develop a package which will import files from a shared drive and load the data to SQL server. The files are expected to be around +-1MB. But, that's not the problem. The files are expected to reach the share drive from midnight
till next day afternoon. The job needs to import the files as it arrives.
What is the best option to handle this.
Thanks.NSG12
January 19th, 2011 1:00pm
you can use WMI Event Watcher to monitor the shared folder and watch if any file appeared then go to import process, for implementing this type of watcher look at this link:
http://www.sqlservercentral.com/Forums/Topic473313-148-1.aspx
also in
this link from MSDN , you will find:
The following query watches for notification that a file has been added to a folder:
SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA "CIM_DirectoryContainsFile" and TargetInstance.GroupComponent= "Win32_Directory.Name=\"c:\\\\WMIFileWatcher\""
http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
January 19th, 2011 1:11pm
Thanks.NSG12
January 19th, 2011 2:04pm
If you use the WMI Event Watcher with files this big, you will get locking issues, because it does not use an EOF (End Of File Marker). Suggest you use Konesans File Watcher, or other 3rd party component...Peter Carter-Greenan http://sqlserverdownanddirty.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
January 19th, 2011 2:09pm