Data From Excel To Table In Ms Sql

  • Hi Frnds,

    Can u guide me, how to insert the data's from excel sheet to a table in ms sql 2005 ?

    For Eg : I am having excel sheets containing 15rows, i want insert those into a table named TABLE_A.

    Thanks in advance

  • Use import export wizard

    check below link it will help you

    http://dotnetslackers.com/articles/sql/Importing-MS-Excel-data-to-SQL-Server-2008.aspx

    Swapnil

  • Thanks for the link, but i need to do the operation using QUERIES

  • If you dont want to use SSIS then you could use OPENROWSET.

    e.g.

    select *

    from OPENROWSET('Microsoft.Jet.OLEDB.4.0',

    'Text;Database=C:\test;HDR=NO',

    select * fromExcelSpreadsheet.csv')

    go

    Depending on the complexity Id suggest using OPENROWSET to transform your data straight into the destination or create a hash table, use OPENROWSET to insert into it, manipulate your data and then insert into your destination.

Viewing 4 posts - 1 through 3 (of 3 total)

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