dbTalk Databases Forums  

How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark
 
Posts: n/a

Default How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 10:51 AM






Thanks in advance.

I have just read a post on www.sqldts.com titled "How can I change the
filename for a text file connection?". The example provided gives me
excellent detail on how to create a text file (destination) with a
changing name based on date which I currently use.

How do I reverse the principle and pull in a file with the following
properties:

\\Server\Directory\staticfilename_$%^*^#@)(&^(Rand om characters).txt

I need to do this now on a daily basis.

I currently use SQL 2000, but will move to SQL 2005 shortly. How do I
do this in both DTS and SSIS?

Mark Simmerman
Napa, CA
SQL Learner

Reply With Quote
  #2  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM






Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #3  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #4  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #5  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #6  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #7  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #8  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
  #9  
Old   
jhofmeyr@googlemail.com
 
Posts: n/a

Default Re: How Do I Reach For a Text File (Source) for File Name With PartStatic and Part Dynamic - 06-05-2008 , 11:03 AM



Hi Mark,

There are a bunch of ways.
The easiest is probably to just use a ForEach loop (even if it only
runs once). Set the Enumerator to "Foreach File Enumerator", the
Folder to "\\Server\Directory\" and the Files to
"staticfilename_*.txt". This will loop through each file in the
directory that matches the specified pattern, set the file name (fully
qualified, name only or name and ext.) to a variable, and then run any
tasks inside the loop container.

Good luck!
J

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.