![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have to write a job to bring in a text file into a sql database. We have a ftp server set up and a place to read the file from. I've been looking at this site: http://www.sqldts.com/default.aspx?292 trying to get some ideas as to how to do this piece of a project. What I need to do is change how we're now doing this process (I receive an email, rename the file, then load into a folder then run sql dts job manually) to get it into our existing table. I want to automate the process, so it'll look out in this folder for the file, use it if it's there (or skip out of the job if it isn't). The filename I know should always be named: yyyymmdd.CUB It needs to be renamed into a file "Current_coop.txt" for input into my existing dts job. However, I need to retain the date that is in the filename (yyyymmdd.cub), and put it into a column on the table (an "as of" date field). Any ideas as to how to do this? The link above sorta-kinda does something like that, but I'm not well-versed enough in using the filesystemobject in DTS to know really what I'm doing. |
#3
| |||
| |||
|
|
Hi BC, "Blasting Cap" wrote: I have to write a job to bring in a text file into a sql database. We have a ftp server set up and a place to read the file from. I've been looking at this site: http://www.sqldts.com/default.aspx?292 trying to get some ideas as to how to do this piece of a project. What I need to do is change how we're now doing this process (I receive an email, rename the file, then load into a folder then run sql dts job manually) to get it into our existing table. I want to automate the process, so it'll look out in this folder for the file, use it if it's there (or skip out of the job if it isn't). The filename I know should always be named: yyyymmdd.CUB It needs to be renamed into a file "Current_coop.txt" for input into my existing dts job. However, I need to retain the date that is in the filename (yyyymmdd.cub), and put it into a column on the table (an "as of" date field). Any ideas as to how to do this? The link above sorta-kinda does something like that, but I'm not well-versed enough in using the filesystemobject in DTS to know really what I'm doing. there are different ways to ahdle this, but before telling you all ways, I would like to understand the hole scenario. Do you plan to mirror something like daily logfiles from a ftp server? Could it be useful to be able to import multiple files for several days? You don't need to rename the file for DTS import - there are other ways - just as a hint to free your mind to clarify what you realy want ;-) Helge Helge - thanks for the response. |
#4
| |||
| |||
|
|
there are different ways to ahdle this, but before telling you all ways, I would like to understand the hole scenario. Do you plan to mirror something like daily logfiles from a ftp server? Could it be useful to be able to import multiple files for several days? You don't need to rename the file for DTS import - there are other ways - just as a hint to free your mind to clarify what you realy want ;-) Helge Helge - thanks for the response. What this is is taking a text file from our system (not the one I am working on), having it FTP'd to an outside source, who'd then take that file & manipulate & update it on their end, then ftp the updated one back to me. Since each load of it would be a direct replacement of the table that's out there now, I see no reason that it'd need to have the ability to accept multiple files. So to answer your first question - it is similar to a daily logfile, but not exactly the same. Question #2 (multiple files for several days) - probably not. This is anticipated to be sent like at least 1 time a week now, but during the closing days of our business year, it would go to 2-3 times a week, up to daily. |
#5
| |||
| |||
|
|
I have to write a job to bring in a text file into a sql database. |
![]() |
| Thread Tools | |
| Display Modes | |
| |