Import Excel file into SQL Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cblevin0822
    New Member
    • Oct 2006
    • 2

    Import Excel file into SQL Server

    Could someone provide me with a URL that explains how to set up DTS to import an Excel file into SQL Server?

    I plan to run this infrequently so there is no need to schedule a recurring run.

    Thanks,
    Craig
  • ittower
    New Member
    • Oct 2006
    • 1

    #2
    Here is sample how to get rows from Excel file in SQL - use OPENDATASOURCE:

    select * from OPENDATASOURCE( 'Microsoft.Jet. OLEDB.4.0',
    'Data Source="\\comp\ share name\filename.x ls";Extended Properties=Exce l 8.0')...['2005$']

    where ['2005$'] is Sheet name in Excel (2005).
    Format ['name$'] uses only for sheets started with digit or contained spaces.
    overwise:
    Sheet1$ for sheet with name Sheet1

    Comment

    • cblevin0822
      New Member
      • Oct 2006
      • 2

      #3
      Thanks for the reply. I will try that.

      If I can get it imported, can I include it as a temp table in queries and would I need a linked server for that?

      Craig

      Comment

      Working...