Solved

Problem with simple SSIS package

Posted on 2013-07-01
5
335 Views
Last Modified: 2016-02-11
I am trying to copy rows from a SQL query into an existing excel file.
The errors I am getting are:

[Excel Destination [1381]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.

[Excel Destination [1381]] Error: Cannot create an OLE DB accessor. Verify that the column metadata is valid.

The t-sql is made up of several columns - most are actual columns and some are aliased empty strings so that there is a like for like match to the spreadsheet.
When I look at column mapping everything looks perfect but I just can't get it to work.
I must be missing something simple. I look at the meta data for the data flow and wonder if there is a mismatch in datatypes (shown in the image) but I can't see a way to change the datatypes

metadata.png
0
Comment
Question by:QPR
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:edtechdba
ID: 39292003
You may want to check the mapping properties on your excel destination in the data flow task, hover over the input fields and output fields and make sure the data types match.

I find that often times I need to use a data conversion task in order to change the data type to match.
0
 
LVL 29

Author Comment

by:QPR
ID: 39292037
They do not match:
int > string
ntext > string

Is this what would cause those cryptic errors?

I think you may be right with the transformation in task, in fact the more I look at what I need to achieve the more I see that it might not be a simple data pump task.
For instance I need to recreate the spreadsheet each time so may use a template with the headers already in place.
0
 
LVL 9

Accepted Solution

by:
edtechdba earned 500 total points
ID: 39292049
If you use a data conversion task in-between the data source and excel destination, you should be able to get the data types to match, map the converted column values to the destination columns.

I like to use file system tasks to copy my "template" file (a blank excel file with the proper headers) into my source file location, then run the data import process in the data flow task. You can set your template file to overwrite the data source file so that it's a prep step prior to every run. That way you know you have a fully refreshed file every run.
0
 
LVL 29

Author Closing Comment

by:QPR
ID: 39292061
Great thanks - no doubt ill be back with more questions
0
 
LVL 9

Expert Comment

by:edtechdba
ID: 39292065
Good luck!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Script to randomly create characters in MS SQL 6 30
SQL Maintenance Plan 3 29
Syntax using Declare 4 38
CROSS APPLY 4 43
In couple weeks ago, I encountered an extremely difficult problem while deploying 2008 SSIS packages to a new environment (SQL Server 2014 standard).  My scenario is: We have one C# application that is calling 2008R2 SSIS packages to load text fi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now