Bulk Insert

  • I have a flat file come in to an FTP server daily. I need to load the flat file into my database daily.

    i need 2 jobs:

    1. Check DIR - If 'New File' - then add to table.....if 'no' the run second job

    2. Check INSERT - Select top 1 from log insert where insert = 'no'

    i need this to loop and keep checking until all fiiles have been inserted, then close.

     

    I am new to this process, can anyone help a little or atleast give me some starting steps?

     

    Thank you

     

  • I went through and looked at your recent posts and it appears that your file import is more than just a simple bulk insert.  It looks like you have a number of steps involved from checking for the existance of the file, unzipping it, comparing the data in the file to the existing table data, importing new data, and loging the import in a log table.  Does this sound accurate?  With all of the steps involved in your file import, I would suggest creating a DTS package to do all of the work.  You can then break down the tasks into DTS tasks and manage the flow of the import and logging.  It would be difficult at best to walk you through how to fully create the DTS package in this thread, so you'll probably have to play around with it on your own.  I would suggest; however, that you think of this in terms of steps and create a task for each step.  Create a staging table where your imported data will live until you can compare the data to your existing data.  I'm sure you'll have more questions, but keep try to keep them in one SSC thread as it will be easier to get help when people understand the big picture of what you're trying to do. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply