SSIS Excel Source - Error with empty DT_NTEXT column - excel

We are currently facing an issue with Excel Source component. We have to read mutipples Excel files with same structure and insert their data into one SQL table.
We use ForEach container that read all the files in the specified folder (with variables) and transfer data to the SQL table. On the first file (whiwh was used for the Excel Source configuration), there is a column with more than 4000 chars (5036 exacly). Excel driver automatically identified it as DT_NTEXT (and it's ok) and the auto-created SQL table has NVARCHAR(MAX) as type.
On the fifth file, this column doesn't contains data at all. And when trying to transfer data, the package fails with the error below
[Excel Source [14]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
[Excel Source [14]] Error: Failed to retrieve long data for column "Comment".
[Excel Source [14]] Error: There was an error with Excel Source.Outputs[Excel Source Output] on Excel Source. The column status returned was: "DBSTATUS_UNAVAILABLE".
[Excel Source [14]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Excel Source.Outputs[Excel Source Output]" failed because error code 0xC0209071 occurred, and the error row disposition on "Excel Source" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Excel Source returned error code 0xC0209029. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
I have made some search on the internet, no solution worked for me.
I tried:
Add IMEX=1 at the end of the Excel ConnectionString
Update the TypeGuessRows value on the registry key for the JET driver
Changed output type on Advanced Editor
and others solutions maybe, but I do not remember them all
Any idea on how to solve this?
Thanks

Related

Cognos Analytics 11.x - Find database vendor type in a query subject definition

I want to find the data source vendor oracle or sql or DB2 on a query subject definition.How to achieve the same?
You can use the lineage tool if the data sources are named properly. https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=vlidi-cognos-analytics-lineage-tool
Alternatively you can create a calculation with a bogus function and examine the error stack. For example an expression of add_spare(current_date) causes the following error:
XQE-DAT-0001 Data source adapter error: com.ibm.db2.jcc.am.SqlSyntaxErrorException: No authorized routine named "ADD_SPARE" of type "FUNCTION" having compatible arguments was found.. SQLCODE=-440, SQLSTATE=42884, DRIVER=3.72.54
RSV-SRV-0042 Trace back:
Which tells you the data source is DB2

Import excel to SQL Server getting Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED

I AM RECIVING EROR:
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.
The PrimeOutput method on Excel Source 1 returned error code 0xC020902A.
The component returned a failure code when the pipeline engine called PrimeOutput().
The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
There may be error messages posted before this with more information about the failure.
My Excel spreadsheet in one of the cells has multiple records similar to this one:
The buyer's xxxXXX xxxXXX xxxXXX xxxXXX xxxXXX xxxXXX "
Regretfully YYY*** YY*** YY*** YY*** YY*** YY*** YY***.
My destination column is nvarchar(MAX) NULL.
Any suggestion how to fix the issue?
This fix the issue with similar problem in my case:
near the Start button press drop-down menu arrow
choose package_name Debug Properties
than under Configuration Properties open Debugging
than under Debug Options choose Run64BitRuntime and turn it to False

Runtime error 5

I am on Day one in learning Excel Macros. As per the tutorial I recorded the macros and tried to run it. (I have used the same file that they have provided in the tutorial and it is a .csv file)
But it showing me the following Error
Runtime Error
Invalid Procedure call or Argument
When I tried to debug it is showing as follows:
Need Help
-Thanks
You can set the CommandType property only if the value of the QueryType property for the query table or PivotTable cache is xlOLEDBQuery, which is enum 5.
This is not the case for your query. In fact, that line doesn't even exist in the source code. Perhaps you attempted to merge scripts? If so, be careful when merging connection code that the types are the same.
If you add in a debug line to get the QueryType
Debug.Print .QueryType
.Name = "receipts"
you will get the enum 6 back. You can look this up using the object explorer:
As would be expected from the connection specification:
ActiveSheet.QueryTables.Add(Connection:="TEXT;

failed to import excel to sql server using ssis package

Hi im developping an ssis package that imports excel files (.xlsx) from an ftp server to a local folder then they are imported to a sql server table . I'm using a foreach mapping to the name of files. The import from the ftp server to local work fine, but the import from the local folder to the sql table failed.
It seems that I have a problem in excel source. These are the errors:
Start SSIS package "Package.dtsx."
Information: 0x1 at Script Task, C # My Message: System.Collections.ArrayList
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase begins.
Error: 0xC0202009 at Data Flow Task, Excel Source [1]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
Error: 0xC02020E8 to Flow Task data, Excel Source [1]: Failed to open a rowset for "Sheet1 $". Verify that the object exists in the database.
Error: 0xC004706B to Flow Task data SSIS.Pipeline: validation failed "component" Excel Source "(1)". Returned validation status "VS_ISBROKEN."
Error: 0xC004700C to Flow Task data SSIS.Pipeline: Failed to validate one or more components.
Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
Warning: 0x80019002 at Foreach Loop Container: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors (6) reached the maximum allowed (1); leading to a failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the value of MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Success.
The program '[5504] Package.dtsx: DTS' has exited with code 0 (0x0).
As configuration I have:
For the excel manager connexion, I made an expression for connectionString = #[User::variable1] + #[User::DOWNLOAD_DIRECTORY_LOCAL] + #[User::FTP_FILE_URL] + #[User::variable2]
variable 1 =Provider=Microsoft.ACE.OLEDB.12.0;Data Source=
variable 2 = ;Extended Properties="EXCEL 12.0;HDR=YES";
I made also the delay validation property to true for data flow task, ftp task, foreach task and excel connection.
I just wrote a package to do the very same thing myself. Things to check in this order:
in your Excel Data Connection have you browsed to the excel files in your local folder (once they are there) and selected one (you need to copy one in there while developing)? so when you go to your excel source object inside your Data Flow Task (inside the For Each) you can select the Excel Data Connection and then see Sheet$1 under "name of the excel sheet"?
Once you are sure you have done above have you then right-clicked on the Excel Data Connection and in the Expressions property added ExcelFilePath = #[User::FTP_FILE_URL]? (note you need to select 'Fully Qualified' under Retrieve File Name on the Collection tab of the For Each container)
in your Excel Data Connection have you selected the right version (Excel 2007) for the .xlsx files or Excel 2003 for .xls? I noticed a small bug where when I changed the filename it defaulted back to 2007, I had to manually change it back (again) to 2003.
Check at least one workbook exists in the folder before the step runs. There is some code around here about how to add a script task to validate at least one file being in User::DOWNLOAD_DIRECTORY_LOCAL.
I got a load of errors about the driver for Microsoft.ACE.OLEDB.12.0, plus had issues with a 64-bit server and had to wrap the package in a job and check the 'use 32-bit runtime' option under execution options in the job properties. Check the driver is working OK (although it usually gives a specific driver error if you haven't got it set up right).
Um that's it offhand just quickly before I head home. Let me know if it works or is still a fail..
The question you should ask yourself when having this issue is:
Where do I run my dstx file from ?
Is it from Microsoft Visual Studio ?
Is it from a SQL Agent ?
Is it from the Integration Services Package Execution Utiliy ?
Then refine your question to find the answer on the forums.

SSIS Excel Source OpenRowset From Variable Error - 0x80040E37

When configuring an Excel Data Flow Component (Source) using the AccessMode of OpenRowset from Variable and setting the correct variable, I get the following error when trying to configure the shape/preview the data:
TITLE: Microsoft Visual Studio
Exception from HRESULT: 0xC02020E8
Error at Merge Files [Excel Source [2]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
Error at Merge Files [Excel Source [2]]: Opening a rowset for "[WORKSHEET]" failed. Check that the object exists in the database.
I have checked that variable name is correctly set to the name of a valid worksheet.
How do I fix this error?
You need to append a dollar sign on the end of the worksheet variable, e.g. WORKSHEET$

Resources