SSIS - Create Batch File to Run Package - batch-file

*****Update*** Also, I have tested utilizing the same database. (extract from one table into another in the same database and it was successful)
New error: Code 0xc029303
Source: Package Connection Manager "Rpt"
Description: The request OLEDB provider ORAOLEDB.1 is not registered. IF the 64-bit driver is not installed, run the package in 32-bit moded
Perhaps it has to do with the multiple connections from Oracle db to SQL db?
FYI: First time creating a Batch file and trying to auto run a SSIS package
Project:
Extract data (one table) from one database (Oracle) to SQL Server, auto execution update, daily.
Short term goal:
Create Batch file and have file execute SSIS package. The SSIS package runs in SSIS with no warnings or errors.
Properties I have changed:
Max Error Count 10
Delay Validation = True
Force Exec Type = Int64
Run 64 BtRunTime = False
I have created a Batch file, see below
"C:\Program Files\Microsoft SQL Server\110 \DTS\Binn\DTExec.exe" /f "C:\Users\J\Desktop\Si\Si\Package.dtsx"
From the CMD I receive the below error:
Code: 0xc0047017
Source: Data Flow Task SSIS.Pipeline
Description: RPT Vendor Data failed Validation and returned error code 0xc020801c
End Error
Progress: 2017-03-20
Source Data Flow Task
Validating: 50% complete
End Progress.
Error: 2017-03-20
Code: 0xc004700c
Source Data Flow Task SSIS.Pipeline
Description: One or more components failed validation
End Error
Error: 2017-03-20
Code:0xc0024107
Source Data Flow Task
Desc There were errors during task validation
End Error
DTExec: The pacakge execution returned DTSER_SUCCES <0>

I was able to adjust the Batch file to relect 32 bit (x86). File below:
"C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\DTExec.exe" /f "C:\Users\J\Desktop\lth\Package.dtsx"

Related

Error 15404 showing when trying to run dtsx file SSIS?

Can anyone help, I have a SQL table built in my database that feeds from an excel file that will be regularly updated. I got it working fine, but I need the data in SSMS to be updated upon refresh (ie: fetch the latest from the excel file).
I have created a dtsx file which I believe is what I need in order to update, but when I go to execute on SSMS I get this error message:
The job failed. Unable to determine if the owner (DESKTOP-DACFOFI\chris) of job UpdateCSKASubs has server access (reason: Could not obtain information about Windows NT group/user 'DESKTOP-DACFOFI\chris', error code 0x534. [SQLSTATE 42000] (Error 15404)).
I saw on other forums that the solution was to change Owner to "sa", but that gave me this error message:
Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 15.0.2000.5 for 64-bit Copyright (C) 2019 Microsoft. All rights reserved. Started: 16:03:36 Error: 2021-04-03 16:03:36.61 Code: 0xC0011007 Source: {122CA6EC-6AEA-452B-95FC-516979E12E61} Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted. End Error Error: 2021-04-03 16:03:36.62 Code: 0xC0011002 Source: {122CA6EC-6AEA-452B-95FC-516979E12E61}
Description: Failed to open package file "C:\Users\chris\Google Drive\CSKA\ImportFromExcel.dtsx" due to error 0x80070005 "Access is denied.". This occurs when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of specifying an incorrect file name when calling LoadPackage or the specified XML file has an incorrect format. End Error Could not load package "C:\Users\chris\Google Drive\CSKA\ImportFromExcel.dtsx" because of error 0xC0011002. Description: Failed to open package file "C:\Users\chris\Google Drive\CSKA\ImportFromExcel.dtsx" due to error 0x80070005 "Access is denied.". This occurs when loading a package and the file cannot be opened or loaded correctly into the XML document.
This can be the result of specifying an incorrect file name when
calling LoadPackage or the specified XML file has an incorrect format.
Source: {122CA6EC-6AEA-452B-95FC-516979E12E61} Started: 16:03:36
Finished: 16:03:36 Elapsed: 0.016 seconds. The package could not be
found. The step failed.
When you run it as sa, the error message indicates that the SQL Agent process cannot access a package in your user space.
To resolve that, deploy the package to somewhere the sql agent can access. The DTS Package Store is likely as good as any. Your error message indicates "SQL Server Execute Package Utility Version 15" so v15 is also SQL Server 2019 so copy the file to
C:\Program Files\Microsoft SQL Server\150\DTS\Packages
Unless you need to run it in 32 bit mode, then copy to (I think - it's been a long while since I've dealt with file system deploys)
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Packages
Depending on whether the Excel file is a local or network resource, you might then run into an issue with connecting to the UNC/mount path but that'll be an artifact of how you have SQL Server/Agent and the job (credentialed user?) set up.

SSIS Error Code DTS_E_OLEDBERROR 0x80004005

I am running an SSIS package that uses OLEDB connections to fetch data from and Oracle 10.2.0.5.0 database and insert it into an SQLServer 2012 (11.0.6260)
I get the following error.
Time: 2021-02-05 01:13:55 AM
Task: Data Flow Task
Error Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
followed by
Time: 2021-02-05 01:13:55 AM
Task: Data Flow Task
Error Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on OLE DB Source returned error code 0xC0202009. 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.
There are no keys or constraints on the destination table.
Both of the dataflow tasks have CommandTimeout set to 0.
All of the other packages with the same source and destination databases run without any problem.
Edit 2
This particular package runs fine on our test/development environment.
I have sinced run the package several times and noticed that the source query returns about 4500 records but only about 500 are inserted into the destination database.
End Edit 2
Is there anything else that I can check for?
Edit 1
The Error message is as it appears in service manager.
The log files just before the error are below.
The source Query is quite along running query. It takes approximately 9 minutes.
End Edit 1
Logging into the oracle database directly with the user that is used for our integrations and running the query gave the following error.
After increasing the size of the user profile the query returned data and the integrations ran correctly.

Issues Looping through Excel Files in SSIS 2012 (Foreach ETL)

I am trying to process Excel files (2007 .XLSX) in a directory on the local machine. There have been a number of issues that have come up of which I will list. Before that let me explain what I want to do and how I have set things up and all my attempts so far.
Set Up
Microsoft Visual Studio 2012
Microsoft Windows 7 (32 bit)
Goal
Create a simple ETL to loop through Excel files in a folder and load data into a SQL server table.
Current Attempts
Note: I am very much familiar with programming and especially loops, however in SSIS I am struggling to get the Excel file from even being read.
I have tried and am doing the following:
Created a package
Created a FOREACH loop container task
FOREACH Loop Task
Set as Foreach File Enumerator
Expression assigns the Directory to the variable which has the value of the directory ('C:\Users\Me\Desktop\Excels\')
Under Variable Mappings I have specified a variable at index 0
Set to using File and Extension
For the moment I am looking at all files (.)
Note: I have used watch on debug to determine if the variables get populated. Now I have tried an expression task to build the full path before moving onto the data flow as well as just using the two variables assigned.
Data Flow (after FOREACH loop container)
Set up Excel File Source
Set up OLE DB Destination
Excel Source (inside Data Flow as the first task)
Set up the columns initially using one of the files (preview and input/output's are shown)
Note: Data is shown so the connection seems fine
Excel Source Connection Manager
DELAY VALIDATION = TRUE
EXPRESSIONS = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + #[User::excelFullPath] + "Extended Properties='EXCEL 12.0 XML;HDR=YES';"
ExcelFilePath = #[User::excelFullPath]
FirstRowHasColumnName = TRUE
Note: I have tried a combination of using the connection string and the excel file path property. I have tried those on their own.
Note: I have two Excel files in the folder for the moment. They are identical with different file names and YES the columns are the same.
Errors Received
The latest error upon RUN is:
SSIS package "C:\Users\biadmin\Desktop\0006AssocImport\0006AssocImport\Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
Error: 0xC0202009 at Data Flow Task, Excel Source 1 [2]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E37.
Error: 0xC02020E8 at Data Flow Task, Excel Source 1 [2]: Opening a rowset for "MAIN$" failed. Check that the object exists in the database.
Error: 0xC004706B at Data Flow Task, SSIS.Pipeline: "Excel Source 1" failed validation and returned validation status "VS_ISBROKEN".
Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.
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 raised (6) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (6) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "C:\Users\biadmin\Desktop\0006AssocImport\0006AssocImport\Package.dtsx" finished: Failure.
The program '[6272] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).
Another Error Received Earlier
SSIS package "C:\Users\biadmin\Desktop\0006AssocImport\0006AssocImport\Package.dtsx" starting.
Information: 0x4004300A at Import RAW Excel Data, SSIS.Pipeline: Validation phase is beginning.
Error: 0xC0202009 at Package, Connection manager "Excel Connection Manager": SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft Access Database Engine" Hresult: 0x80004005 Description: "Could not find installable ISAM.".
Error: 0xC020801C at Import RAW Excel Data, Excel Source [2]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Error: 0xC0047017 at Import RAW Excel Data, SSIS.Pipeline: Excel Source failed validation and returned error code 0xC020801C.
Error: 0xC004700C at Import RAW Excel Data, SSIS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Import RAW Excel Data: 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 raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "C:\Users\biadmin\Desktop\0006AssocImport\0006AssocImport\Package.dtsx" finished: Failure.
These are not all the errors received (I did not record all of them) but at the moment its just failing on one particular error at a time.
Note
I have seen quite a few YouTube tutorials and read a few outlining the exact steps. I have seen one where they set the connection manager from a Script task before getting to the Data Flow task. I saw one where the ConnectionString property was set only to the variable that holds the Excel File Path.
Questions
What am I missing in my set up
After configuring the connection manager to look at a variable for the file is there anyway of still configuring inputs and outputs on the Excel Source task because at the moment its showing an error
What is the developer preference in SSIS for this sort of situation where I prefer to see the column mappings on the configuration box (Script or Flow)

The AcquireConnection method call to the connection manager failed with error code 0xC001A004

I use SQL Server 2014 and SSIS with Visual studio 2013.
I need to make some changes in one OLTP database (Here it is my destination database) in several tables with one of my SSIS package, and some times that takes a lot of time to execute and during this time it locks some tables in OLTP database and I can't anymore work with may application which works with OLTP database.
Before my package have been run one time in day and it was at midnight but now we decided to run this package every 30 min.
I need to use snapshot isolation level in OLTP databse to be sure that SSIS package does not lock the table for long time.
At first I want use IsolationLevel equal to Snapshot but it does not work.
Then I found that I should handel the Isolation leve manually inside the ControlFlow for using the Isolation Snapshot.
I have created a sample because my real SSIS package is really huge.
I have created a database and then, I have set Allow snapshot isolation with true.
After that I have created a SSIS package in which I have these variables:
Then I have created a Control flow like that :
In the first SQL Execution Task I have run this command:
SET TRANSACTION ISOLATION LEVEL SNAPSHOT
Then in second SQL Execution Task I have started a Transaction :
BEGIN TRANSACTION
Then I have added a Dataflow task. Inside of my DataFlow task there are two OLE DB. One as source and second one is destination.
The source and target are both in the same server and in the different database.
Then I change the property of my Connection Manager like below :
And then I have installed and configured my MSDTC in my computer. (Source and Destination are both on the same server and ssis package is running in the same server).
Then I configur my service like that :
Then in my firewall I have given the access to MSDTC like that :
Then I have configured my firewall's advance configuration like that :
All of the Task in my SSIS package have these configurations for IsolationLevel and TransactionOption :
My control flow has these configurations :
When I run the package I get this error in my OLE DB destination.
[OLE DB Destination [2]] Error: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.
The AcquireConnection method call to the connection manager
".<ServerName>.<DatabaseName>" failed with error code 0xC001A004.
There may be error messages posted before
this with more information on why the AcquireConnection method call failed.
[SSIS.Pipeline] Error:
OLE DB Destination failed validation and returned error code 0xC020801C.
What should I do to be able to handel manually the transaction and isolation level as Snapshot in my SSIS package?

SSIS transactions with multiple OLE DB commands

I have the following Data Flow task in my SSIS package:
alt text http://img228.imageshack.us/img228/358/ssis1.png
It reads a file from an external vendor that has records with a column "change" that cointains A, C or D for add, change and delete. I have to process these in my SQL Server database. The conditional split checks the value of the change column and sends the row off to the appropriate command. This works fine.
Because the input files sometimes contain errors I would like to make this process transactional (there are 10 of these Data Flow tasks).
If I enable transactions on the SSIS package however the OLE DB commands seem to interfere with each other (they do not operate on the same rows). I get the error:
Error: 2010-02-02 12:21:08.39
Code: 0xC0202009
Source: name OLE DB Command 1 [58]
Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred.
Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0
" Hresult: 0x80004005 Description: "This operation conflicts with another pend
ing operation on this transaction. The operation failed.".
End Error
Error: 2010-02-02 12:21:08.39
Code: 0xC004701A
Source: name SSIS.Pipeline
Description: component "OLE DB Command 1" (58) failed the pre-execute phase
and returned error code 0xC0202009.
End Error
Progress: 2010-02-02 12:21:08.39
I have tried any order of the conditional split and all the IsolationLevels on the Transaction settings but nothing seems to work. If I make the conditional split use only 1 of the branches it works fine.
How to proceed?
Try replacing SQL Server Destination with a "OLEDB Destination" for the inserts.
SSIS is so bad it makes me scream - Seriosuly you should revist whether SSIS is the correct tool here

Resources