SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Problem inserting excel data to existing table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sapator
Constraint Violating Yak Guru

Greece
424 Posts

Posted - 07/25/2014 :  09:54:16  Show Profile  Reply with Quote
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

Greece
424 Posts

Posted - 07/25/2014 :  10:08:47  Show Profile  Reply with Quote
Please ignore. I was given an empty excel file! Grrrrrr!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000