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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Problem inserting excel data to existing table

Author  Topic 

sapator
Constraint Violating Yak Guru

462 Posts

Posted - 2014-07-25 : 09:54:16
Hi. I am doing a bulk

Select *
into tempscenarioxls
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;HDR=YES;Database=C:\z\databasebulks\excel\testxlssmall.xlsx',
'SELECT * FROM [ASSIST_05_08_2013$]');

This will work fine, however, afterward, if i do:

INSERT INTO tempscenarioxls
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;HDR=YES;Database=C:\z\databasebulks\excel\testxlssmall.xlsx',
'SELECT * FROM [ASSIST_05_08_2013$]');

This will only insert NULL's in the next rows.
Any help?
Thanks.

sapator
Constraint Violating Yak Guru

462 Posts

Posted - 2014-07-25 : 10:08:47
Please ignore. I was given an empty excel file! Grrrrrr!
Go to Top of Page
   

- Advertisement -