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. mapping help.

mapping help.

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintoolshelp
3 Posts 3 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.
  • N Offline
    N Offline
    NasimKaziS
    wrote on last edited by
    #1

    I need to do the below: Import the excel file using the available SQL server tools to a temp db. Then write a mapping between the temp db and the Main database. Move the data to the Main database. Is this possible?? -----------------------------------------------------------------

    where there is a will there is a way

    C A 2 Replies Last reply
    0
    • N NasimKaziS

      I need to do the below: Import the excel file using the available SQL server tools to a temp db. Then write a mapping between the temp db and the Main database. Move the data to the Main database. Is this possible?? -----------------------------------------------------------------

      where there is a will there is a way

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      INSERT INTO TableName(Column1, Column2, etc)
      SELECT Column1, Column2, etc FROM #TempTableName


      Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website

      1 Reply Last reply
      0
      • N NasimKaziS

        I need to do the below: Import the excel file using the available SQL server tools to a temp db. Then write a mapping between the temp db and the Main database. Move the data to the Main database. Is this possible?? -----------------------------------------------------------------

        where there is a will there is a way

        A Offline
        A Offline
        Aaron VanWieren
        wrote on last edited by
        #3

        You should be able to use the oledb provider to link to excel and import the data into a datatable. From there you could use SQLBulk Copy to move the data easily if your column headers are the same, otherwise you will need to map the columns. If you do not want to this in code then the other suggestion might be better.

        _____________________________________________________________________ Our developers never release code. Rather, it tends to escape, pillaging the countryside all around. The Enlightenment Project (paraphrased comment) Visit Me at GISDevCafe

        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