Starting SSIS package execution when entering files in a folder

I have a script in SSIS. I have a package that is simply moving data from a flatfile to a database. I have a specific location and I want to execute this package when the file is in a folder.

+4
source share
2 answers

Step by Step Using the WMI Event Watcher Task

  • Create a WMI Connection Manager. Use Windows credentials at startup locally (you must be an administrator to access WMI event information) and enter credentials at remote startup (be sure to encrypt your packets!).
  • WMI. WQLQuerySource WQL .

WQL SQL-, , , :

SELECT * FROM __InstanceCreationEvent WITHIN 10 
WHERE TargetInstance ISA "CIM_DirectoryContainsFile" 
and TargetInstance.GroupComponent= "Win32_Directory.Name=\"c:\\\\WMIFileWatcher\"" 

, escaping, .

enter image description here

  1. WMI. Foreach , .

enter image description here

  1. " " " " .

enter image description here

  1. (, ConnectionString ), .

, , .

Event watcher wired up to foreach file enumerator

, For EvalExpression, true == true.

enter image description here

PowerShell SSIS . , .

+8

WMI , / . ForEach Loop Container Execute SQL Wait, For Loop Container.

ForEach, , . - Script, Files_Found - , .

ForEach Loop Container SQL Execute , . WAITFOR DELAY '00:05:00' 5- .

ForEach Loop Execute SQL For Loop, Files_Found.

- - , , , WMI.

+2

All Articles