import data from excel to sql table

  • hi,

    could you please let me know how to import data from Excel to sql server table.

  • This is usually done with Integration Services (SSIS). If it's a one-time import you can use the Import/Export Wizard in SSMS. Just right-click on the destination database, select Tasks, then select Import Data. The Wizard will walk you through selecting a source and destination.

    If it's to be an ongoind import process, you can still start with the Wizard and save as a package, which can be run repeatedly. See BOL for details.

    Greg

  • It's also possible to copy and paste directly into the table in management studio if the layout of your spreadsheet matches the table.

    If you're looking for a programmatic method, look up OPENROWSET, particularly with the BULK option.

    -a.



    Dan Guzman - Not the MVP (7/22/2010)
    All questions have to be prefaced by Server version and 'according to MS Docs' or 'my own personal opinion based on how much detail I felt like digging into at the time.'

  • Feebie (10/14/2009)


    hi,

    could you please let me know how to import data from more than 2 Excel files to sql server table.

  • luthrarahul (3/27/2010)


    Feebie (10/14/2009)


    hi, could you please let me know how to import data from more than 2 Excel files to sql server table.

    Why did you add that?

  • hi there

    being a newbie to this myself - try doing it either one by one either using SSIS or Importing data from SQL SERVER in itself. or this can be done in SSIS by manually building a package to import data.

    Hope this helps. Let me know if you need some help with this and I can try and help you out as I am learning myself this would be a good experience

    Vani

  • To add data from more than 1 Excel file repeat whatever you choose to do for the first one....

    If once only, cut and paste multiple times (if the same data struct...).

    If you choose SSIS, created either by running BIDS or saving an Import wizard sequence of steps, solve it within the SSIS package.

    You may also use a direct selection from the spreadsheet ... if you're game...

    SELECT

    FROM OPENDATASOURCE(

    'Microsoft.Jet.OLEDB.4.0',

    'Excel 8.0;DATABASE=\\srvNam\foldName\XLS\MergedProd.xls')...[SheetName$] AS ProdXLSset

Viewing 7 posts - 1 through 6 (of 6 total)

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