Forum Moderators: open

Message Too Old, No Replies

Need help with Text File Import to MS SQL

         

IntegrityWebDev

1:51 pm on Sep 3, 2010 (gmt 0)

10+ Year Member



Hello all, I have a space delimited text file that is sitting on the web server as .dat file. I need to do the following:

1) Clear out the current db table.
2) Import .dat file into db table.
3) Schedule this to run each night.

Its a Windows Server 2003 if that helps.

I'm fairly outside my realm here so any help anyone can give would be aprpeciated!

Thanks,
Chris

LifeinAsia

3:28 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What DB are you using?

IntegrityWebDev

4:46 pm on Sep 3, 2010 (gmt 0)

10+ Year Member



MS SQL

IntegrityWebDev

5:14 pm on Sep 3, 2010 (gmt 0)

10+ Year Member



One correction...its not SPACE DELIMITED but FIXED WIDTH...sorry about that.

LifeinAsia

10:45 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I'd use DTS (renamed SQL Server Integrated Services), save the package, and schedule it to run every night. The Import and Export Wizard walks you through the steps:
choose a data source (flat file), select the file name, and go from there.

There are many branches depending on the data itself, so it's kind of hard to give directions past that point. Post again if you run into any difficulties.

IntegrityWebDev

8:05 pm on Sep 5, 2010 (gmt 0)

10+ Year Member



Will start there, thanks!