ewm
2009-11-12 00:24:08 UTC
I am writing a SSIS package (SQL2005) and need to watch a folder for the
appearance of a text file. I am using the WMI Event Watcher task. This WQL
code will correctly monitor for any file coming into the folder:
SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA
"CIM_DirectoryContainsFile" and TargetInstance.GroupComponent=
"Win32_Directory.Name=\"c:\\\\ReceiveQueue\""
I thought that I could add teh TargetInstance.Extension to the WQL query
like this:
SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA
"CIM_DirectoryContainsFile" and TargetInstance.GroupComponent=
"Win32_Directory.Name=\"c:\\\\ReceiveQueue\"" AND TargetInstance.Extension=
"txt"
however, that did not work. I have tried putting the txt in single quotes
inside the double quotes and using single quotes alone but nothing seems to
work.
What's the secret. Thanks in advance.
appearance of a text file. I am using the WMI Event Watcher task. This WQL
code will correctly monitor for any file coming into the folder:
SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA
"CIM_DirectoryContainsFile" and TargetInstance.GroupComponent=
"Win32_Directory.Name=\"c:\\\\ReceiveQueue\""
I thought that I could add teh TargetInstance.Extension to the WQL query
like this:
SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA
"CIM_DirectoryContainsFile" and TargetInstance.GroupComponent=
"Win32_Directory.Name=\"c:\\\\ReceiveQueue\"" AND TargetInstance.Extension=
"txt"
however, that did not work. I have tried putting the txt in single quotes
inside the double quotes and using single quotes alone but nothing seems to
work.
What's the secret. Thanks in advance.