Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want import and export data in sql server using query.
My System is 64 bit and Office Is 32 bit.
Posted

Use OPENDATASOURCE [^]to select data from your Excel file:
SQL
SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\temp\Excel.xls;Extended Properties=EXCEL 5.0')...[Sheet1$] ;

If you want to import data from Excel into a new table use INTO syntax:
SQL
SELECT * INTO excelTable FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\temp\Excel.xls;Extended Properties=EXCEL 5.0')...[Sheet1$] ;
 
Share this answer
 
 
Share this answer
 
Hi,

Check this...

How to import data from excel to SQL[^]

Hope this will help you.


Cheers
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900