Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Automatic Import?

Automatic Import?

Scheduled Pinned Locked Moved Database
questiondatabaseworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robby
    wrote on last edited by
    #1

    I need to take a delimited file and import it into a SQL table. The table is already setup and I have MANUALLY imported the file to populate it and get it going. This file will be updated EVERY night and I want to keep the table updated. How do I automate this? What is the SQL code? Should I drop the table and re-create it nightly?

    Richard DeemingR 2 Replies Last reply
    0
    • R Robby

      I need to take a delimited file and import it into a SQL table. The table is already setup and I have MANUALLY imported the file to populate it and get it going. This file will be updated EVERY night and I want to keep the table updated. How do I automate this? What is the SQL code? Should I drop the table and re-create it nightly?

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      In your DTS task (You do have a DTS task, don't you?! :-D ), issue a TRUNCATE TABLE command to delete all rows from the table, and then import the data.

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • R Robby

        I need to take a delimited file and import it into a SQL table. The table is already setup and I have MANUALLY imported the file to populate it and get it going. This file will be updated EVERY night and I want to keep the table updated. How do I automate this? What is the SQL code? Should I drop the table and re-create it nightly?

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Reply to the forum, please! Robby wrote: i appreciate the information, but is there anyway you can give a code example? i have never created a table from a txt file, only standard SQL INSERT stuff. the file is pipe delimited and column names are on first row...any ideas? Thanks, Robby

        1. Open up SQL Server Enterprise Manager.
        2. Right-click on the target database, and choose All Tasks -> Import Data.
        3. For the source, choose Text File, and select your text file.
        4. Follow the instructions to set up the import.
        5. In the final screen, select Scheduled DTS package for later execution, and click on the "..." button to set up the schedule.

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups