Excel schema using Jet OLEDB Provider?

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

Is there a way to query the Jet OLEDB Provider for Excel
to find out the COlumn Names and DataTypes of an Excel
worksheet? I want to import an Excel file into SQL Server
and need to create the table on the fly for that file and
set the column datatypes for that table. What would be
the best way to accomplish this? Thanks!
 
Do you mean a temporary table or one that will persist? I think you
can only create a temporary SQL Server table from Excel. A temp table
will only persist as long as the connection that created it remains
open i.e. it is automatically deleted as soon as it is detected as
being no longer used. This is for security reasons. You will have to
create a permanent table from within SQL Server so you may as well do
the data import from there. Creating permanent tables on the fly is
not really how a RDBMS should be used, IMHO.
 
Back
Top