Click here to Skip to main content
12,504,984 members (62,591 online)
Click here to Skip to main content
Add your own
alternative version

Stats

40.8K views
9 bookmarked
Posted

Reading Excel file in SQL Server

, 17 Jan 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Shows how to read an Excel file using SQL query commands from SQL Server
Syntax:
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
          'Excel 8.0;Database=<FILE_PATH>',
          'SELECT * FROM [Sheet1$]')


Example:
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
          'Excel 8.0;Database=\\labdbs1\APPLICATIONS\branch.xls',
          'SELECT * FROM [Sheet1$]')

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

pankaj_254768
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralJust what we were looking for today Pin
Member 1068382119-Mar-14 11:27
memberMember 1068382119-Mar-14 11:27 
QuestionI get an error regarding JET OLEDB Pin
sharp_k19-Apr-12 10:46
membersharp_k19-Apr-12 10:46 
Generalnice 1!!! thanx Pin
sun_ak4725-Dec-11 22:01
membersun_ak4725-Dec-11 22:01 
GeneralReason for my vote of 5 nice Pin
cgy22015-Aug-11 22:27
membercgy22015-Aug-11 22:27 
GeneralReason for my vote of 4 thanks for sharing Pin
Pranay Rana17-Jan-11 23:07
memberPranay Rana17-Jan-11 23:07 
GeneralEdited all-caps, added description Pin
Indivara17-Jan-11 21:22
subeditorIndivara17-Jan-11 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 18 Jan 2011
Article Copyright 2011 by pankaj_254768
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid