Dtata transfar from excel to sql 2000

  • I have the data in EXCEL sheets now I want to store this data in different Tables in one SQL Server 2000 Database by matching the column names in Excel and with Sql 2000 DB Column Names..

    If there is any easy way to store, can you please let me know.

  • Use the OPENROWSET function

    Example:

    INSERT INTO (column_name)

    SELECT *

    FROM OPENROWSET

    ('Microsoft.jet.oledb.4.0','Excel 8.0;Database= $]')

    Change:

    1. with your table name

    2. (column_name) with the column in the table

    3. path of the excel file (there are no spaces between '=' and the path)

    4. column_name column name in the excel file (always has '$' after the sheet name

    5. Name of the Excel Sheet

    "-=Still Learning=-"

    Lester Policarpio

  • Use the OPENROWSET function

    Example:

    INSERT INTO (table_name) (column_name)

    SELECT *

    FROM OPENROWSET

    ('Microsoft.jet.oledb.4.0','Excel 8.0;Database=(path)','Select column_name FROM [(Sheet_Name)$]')

    Change:

    1. (table_name) with your table name

    2. (column_name) with the column in the table

    3. (path) path of the excel file (there are no spaces between '=' and the path)

    4. column_name column name in the excel file (always has '$' after the sheet name

    5. (Sheet_Name) Name of the Excel Sheet

    "-=Still Learning=-"

    Lester Policarpio

  • thanks

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

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