RE: Importing Text File DTS question

RE: Importing Text File DTS question

 

  

look at the link:
http://www.sqldts.com/default.aspx?6,103,246,0,1
this shows how to loop through and import multiple files from a directory.
(also can be reached from sqldts.com FAQ, workflow, looping and archiving)

Good luck.

Brian Freeman
(770) 916-0595 ext. 415
Carnegie Technologies/Bluewave Computing
www.carnegie.com and www.bluewave-computing.com

Craig Rosenblum wrote:
> You need to use global variables...
>
> for example create a query, that comes up with the values for a global
> variable.
>
> The tricky part is that I don't think you can dynamically re-do a
> textfile connection.
>
>>>> "Beal, Jeremy" <[Email Address Removed] 7/30/2003 12:05:55 PM >>>
> The filename is a simple date format ie: 0703mto.txt
> the first two is the month, the next 2 is the year, and mto is the
> kind of data
>
> and i am using sql server 2k
>
> Jeremy Beal
>
> -----Original Message-----
> From: Lepingwell, Christopher [mailto:Christopher.[Email Address Removed] Sent: Wednesday, July 30, 2003 9:57 AM
> To: Beal, Jeremy; LazyDBA.com Discussion
> Subject: RE: Importing Text File DTS question
>
>
> Depends really, probably the most important thing is how to calculate
> the
> correct date/month etc. The crux of the matter, though, is to use a
> VBScript task to create the text string for the filename, and post
> that to a
> DTSGlobalVariable. You then use that variuable in Execute SQL task
> (assuming you are using SQLServer2K).
>
> -----Original Message-----
> From: Beal, Jeremy [mailto:[Email Address Removed] Sent: 30 July 2003 17:57
> To: LazyDBA.com Discussion
> Subject: Importing Text File DTS question
>
>
> Hello fellow DBA's,
>
> Lets hope this makes sense.
>
> I am using a DTS Package that I created.
>
> I am using an Execute Sql Task. Within this I am simply deleting
> records for
> the current month.
>
> Upon success, then I am importing using Text File (source). Within
> this, it
> has a form whose properties have the filename, and various settings to
> import the file. Basically I am appending data from a text file to a
> table
> whose records were deleted for the current month.
>
> Problem: Is there another way to import text file programmatically.
> The text
> file (source) has the fixed name of the text file. I would like to be
> able
> to change the file name thru code. Lets say it is august, i would like
> the
> code to look for a filename for august, instead of july. I need it to
> be
> done automatically without manual editing the DTS package.
>
>
> Regards,
>
> Jeremy Beal
> Shamrock Materials Inc.
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page