Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Kluivert
Starting Member
1 Post |
Posted - 2008-12-17 : 12:35:14
|
You have all seen this. Right?Originally posted by madhivananApart from using DTS and Export wizard, we can also use this query to export data from SQL Server2000 to ExcelCreate an Excel file named testing having the headers same as that of table columns and use this queryinsert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;', 'SELECT * FROM [SheetName$]') select * from SQLServerTableTo export data from Excel to new SQL Server table, select * into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;HDR=YES', 'SELECT * FROM [Sheet1$]')To export data from Excel to existing SQL Server table, Insert into SQLServerTable Select * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;HDR=YES', 'SELECT * FROM [SheetName$]')MadhivananFailing to plan is Planning to failcan i do this with excel 2007??Questions1. Can Someone explain in simple terms the syntax.2. Depending on the office currently installed on my machine, how would i know the reference to excel i need to refer to. I mean, for example using office 2003. What would excel reference would i use and how would i check that supposing i upgrade to 2007 or use 2000?RegardsDavid |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|