RE: Using a wildcard with the FTP Task
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Wed, 26 Jul 2006 05:25:52 GMT
Hi Jason,
Welcome to the MSDN newsgroup.
As for the SQL server DTS taskobject's "SourceFileName" property, based on
my research, this property can only contains file entries (construct a file
list) which have fixed filename and path. And the syntax must be strictly
following the below pattern:
'name1';'path1';'size1';'name2';'path2';'size2';'name3';'path3';'size3'
Wildcard or any other parituclar search pattern specific characters can not
be embeded in the path list, and the DTS engine has no sense of such
characters which will cause the error you encountered.
BTW, I'm wondering what's your detailed scenario or background on this
issue. Is it possible that you use any other programming interface such as
..net framework or cpp or only pure script here? If some rich programming
interface is allowed in your scenraio, you can consider programmatically
use some filesystem component to query the file lists(with certain search
pattern or wildcard) from the remote share server, and also programmtically
construct such a file list (string ) for the dts taskobject's
"SourceFilename" property. As far as I know, .net framework has rich
file IO component that can list or search files on a specific NTFS file
location. If you're limited in vbscript, you can consider use
FileSystemObject to loop file on the certain share folder and capture all
the files matchs expected pattern. e.g:
=====================
Set objShell = CreateObject ("Shell.Application")
Set objFolder = objShell.Namespace ("\\server\sharename")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim arrHeaders(13)
For i = 0 to 13
arrHeaders(i) = objFolder.GetDetailsOf (objFolder.Items, i)
Next
For Each strFileName in objFolder.Items
if not InStr(strFileName, ".dat") = 0 then
For i = 0 to 13
If i <> 9 then
Wscript.echo arrHeaders(i) _
& ": " & objFolder.GetDetailsOf (strFileName, i)
End If
Next
end if
Wscript.Echo
Next
=======================
Then, you can construct a path list through the query result for your DTS
task object's sourcefilename property. How do you think of this?
Please feel free to post here if you have any other ideas or consideration.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial
response from the community or a Microsoft Support Engineer within 1
business day is
acceptable. Please note that each follow up response may take approximately
2 business days
as the support professional working with you may need further investigation
to reach the
most efficient resolution. The offering is not appropriate for situations
that require
urgent, real-time or phone-based interactions or complex project analysis
and dump analysis
issues. Issues of this nature are best handled working with a dedicated
Microsoft Support
Engineer by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Prev by Date: Normalized flat file as a source in SSIS
- Next by Date: Need help with ActiveX Script!!!
- Previous by thread: Normalized flat file as a source in SSIS
- Next by thread: Need help with ActiveX Script!!!
- Index(es):
Relevant Pages
|