Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Updating flat file source database

Author  Topic 

ksabine
Starting Member

3 Posts

Posted - 2009-01-23 : 04:23:17
First, let me apologize for being such a novice about SQL. I have a strong IT background for server 2003 but not SQL.

My dilemma:

I have a tab delimited .txt file that I need to make a database out of that our programmers can query. So ... I used the import wizard to configure my columns and import the data and the table looks perfect. All the columns I need are intact, labeled right, and with the right data. Exactly what I need.

My struggle is that this .txt updates every 3 hours, and my database needs to also. So, I need to figure out a way to make my table update automatically every time this file updates.

Sounds like it would be simple to me but I can't figure it out. Any help would be appreciated.

Thank you

revelator
Starting Member

32 Posts

Posted - 2009-01-23 : 04:27:53
This may be of use...

[url]http://www.sqlis.com/post/file-watcher-task.aspx[/url]

Alteratively set up a job to run the package every few hours?



-----------------------------------
Waiting for the Great Leap Forwards
Go to Top of Page

ksabine
Starting Member

3 Posts

Posted - 2009-01-23 : 04:42:39
I would rather not use 3rd party software if at all possible.

I will check into the jobs aspect of SQL 2005
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2009-01-23 : 09:02:46
- Create specific folders Incoming and Processed
- Invest some time creating a package that processes the data as you would with Import Wizard (ETL using Data Flow Task)
- Use ForEach Loop File Enumeration
- Within ForEach Loop, move processed file to Processed folder so Incoming folder is empty
- Use SQL Agent to run package every three hours

There are many ways of accomplishing those tasks in SSIS including FileWatcher component run as Windows service.
Go to Top of Page

ksabine
Starting Member

3 Posts

Posted - 2009-01-24 : 02:53:20
Thank you for the assistance getting my database created and updating.

However, it turns out updating the database is not what I'm having struggles with (at this point), it is updating my source.

My source is a .txt file located on an external web server, lets call is http://www.what.com/huh.txt


Below is how my structure works:

http://www.what.com/huh.txt >>> C:\huh.txt >>> SQL database

Getting http://www.what.com/huh.txt to update C:\huh.txt automatically is what im having issues with.

Any help would be appreciated
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2009-01-27 : 06:38:16
How about setting up a FTP download from that domain? Meaning, you can set up the package using FTP Task as part of your flow to download the data locally.
Go to Top of Page
   

- Advertisement -