Solved

Problem with simple SSIS package

Posted on 2013-07-01
5
336 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
View SQL 2005 Job package 16 70
export sql results to csv 6 40
SQL Server 2012 r2 - Varible Table 3 32
Master DB with Masterkey 1 34
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
My client has a dictionary table. They're defining a list of standard naming convention. Now, they are requiring my team to provide us a mechanism how to match new incoming data with existing data in their system.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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