0

I have used below procedure code but its throwing an error:

Code:

SELECT * into TestTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\ExamCenter.xls;HDR=YES;IMEX=1;', 'SELECT * FROM [user$]')

error:

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Manish Mishra
  • 31
  • 2
  • 5
  • can you share the actual code you are running? – No Idea For Name Jul 23 '13 at 09:56
  • read this article I hope it is helpful for you. [http://stackoverflow.com/questions/338776/creating-a-sql-table-from-a-xls-excel-file](http://stackoverflow.com/questions/338776/creating-a-sql-table-from-a-xls-excel-file) – Manish Sharma Jul 23 '13 at 10:06
  • i have to create table based on excelsheet data structure, means columns of table decided based on excelsheet data. – Manish Mishra Jul 23 '13 at 10:12

1 Answers1

0

Please use the following link to find an example

Import Export example

arj.N
  • 1
  • 1
  • i know these thing, my concern is i have excel with data and based on that data at run time create a table based on excel sheet data structure and import data. – Manish Mishra Jul 23 '13 at 10:10