SSIS Package to copy data from one to another error - ssis

I have setup a SSIS package to copy over some data from one table to another. At first I tried doing from one server to another server, did not succeed. Then I tried it doing within the same server, no luck again. I followed couple tutorials/videos how to do it and followed the exact pattern.
However here's what I tried to do:
Create a "Data Flow Task"
Under "Data Flow" tab create an "OLE DB Source" and "OLE DB Destination"
Configure the "OLE DB connection manager" and setup the column mapping, verify connection status for both source and destination
When I run the package I get following errors
Here are the 5 errors that are in the above figure,
[OLE DB Destination 2] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "STLEDGSQL01.MES_DEV" failed with error code 0xC0202009. 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.
[SSIS.Pipeline] Error: One or more component failed validation.
Error: There were errors during task validation.
[Connection manager "STLEDGSQL01.MES_DEV"] Error: 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 11.0" Hresult: 0x80004005 Description: "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Client unable to establish connection".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Registry information is corrupt or missing. Make sure the provider is installed and registered correctly.".
Now I have tried applying couple of solution that I found in stackoverflow and out in the internet, such as following but nothing helped me so far.
Set delay validation property at package level to True from false
Change ProtectionLevel to EncryptSensitiveWithUserKey
Any help is greatly appreciated!

For anyone who's interested or had the same issue as mine, I just found the answer. I was using the wrong TargetServerVersion in project properties. My SQL server is 2016 and it was defaulted to 2019 automatically in this property page. I did change it back to 2016 and yes it all starts working.

I suggest that you do not use SSIS to move data around inside a database. Just use a stored prcedure or script. Here is a sample script that will copy data from one table to another, but only for data that doesn't exist in the target.
insert into targettable (PrimaryKeyColumn,Column1,Column2,Column3)
select PrimaryKeyColumn,Column1,Column2,Column3
from sourcetable SRC
where not exists (
select *
from targettable TGT
where TGT.PrimaryKeyColumn = SRC.PrimaryKeyColumn
)

Related

SSIS Error Code DTS_E_OLEDBERROR: 0xC0202009

I created a new package today, it gets info passed down from a Master package that runs other packages as well. My master package pulls the connection info from a config file at runtime. Protection level = DontSaveSensitive. Using Windows Authentication. It works fine locally but when I run it from a job it gives me the error below.
Any ideas or constructive comments are welcome!
Code: 0xC0202009 Source: DFT - Insert Into StageSites Source DB TEICommon [1] Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Statement(s) could not be prepared.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Invalid column name 'SuspendedDate'.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Invalid column name 'FirstShipmentDate'.". End Error Error: 2016-10-28 10:38:02.50 Code: 0xC004706B Source: DFT - Insert Into StageSites SSIS.Pipeline Description: "component "Source DB TEICommon" (1)" failed validation and returned validation status "VS_ISBROKEN". End Error Error: 2016-10-28 10:38:02.50 Code: 0xC004700C Source: DFT - Insert Into StageSites SSIS.Pipeline Description: One or more component failed validation. End Error Error: 2016-10-28 10:38:02.50 Code: 0xC0024107 Source: DFT - Insert Into StageSites Description: There were errors during task validation. End Error
Update: [Fixed]
I solved the issue by updating my schema in the database my ETL query was pulling from.
Here are your actual errors:
"Invalid column name 'SuspendedDate'.".
"Invalid column name 'FirstShipmentDate'.".
You are querying a table (in the component Insert Into StageSites) , expecting those columns to exist when they do not. Since you say it works locally but not from a job, the most likely explanation is that your DataSource is connecting to a different server when the job runs it than the one it connects to locally. Check the connection string in the .config file on the server that the job points to.

SSIS Logging Throws an Error

I have programmed some ETL which works OK, the processing finishes without errors. Now I want to create a log using SSIS Loggin feature.
However, once I set this logging up (SSIS log provider for SQL Server; all events; all cotainers are checked, also the log is checked) and start the ETL, the MS Visual Studio 2008 app return error window with not error specified in it so I don't have even clue what could be the problem. The destination of ETL is SQL Server 2008 R2. The credentials are the same as my AD account, I have no problem to write the data into this DB (respectivelly it's tables).
To sum up, the whole ETL run works without problem, but once the SSIS Logging is turned on, the ETL does not even start.
One notice: the log table was created in the DB though [domain\user_name].[sysssislog]. Also the logging to e.g. text file works without any problems.
Any suggestions, please?
+++
Error I am receiving
TITLE: Package Validation Error
Package Validation Error
ADDITIONAL INFORMATION:
Error at Reporting_v3 [Log provider "SSIS log provider for SQL Server"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "There is already an object named 'sysssislog' in the database.".
Error at Reporting_v3 [Log provider "SSIS log provider for SQL Server"]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.
There is like around 500 rows with the same error. If I delete the ssislog table and run the package with SSIS Logging turned on, the table is created again and the same error pops up.
Fixed. The solution can be found at the following link:
http://connect.microsoft.com/SQLServer/feedback/details/467794/ssis-log-provider-for-sql-server-do-not-work-when-default-schema-is-not-dbo-sysdtslog90-sysssislog

Excecuting SSIS package deployed in Integration Service Catalog

I have edited my entire question, first my question was how to execute the SSIS Package, but now I have got the solution to execute it via SQL Server Agent job but when I am trying to execute the SQL Server Agent job, I am getting error , when I viewed in history then following message is shown
Job failed. Job was evoked by the user. Last step to run was step 1.
please note the table where I am inserting the data into database via SSIS package in SQL Express, is it SQL Express creating problem.
---------Updated Error Message-------------
The following error message is seen when I expand log file of SQL Server Agent job,
Executed as user: NT Service\SQLAgent$SQL_Server_Evalu. Microsoft(R) SQL Server Execute Package utility Version 11.0.2100.60 for 64 bit copyright (C) Microsoft Corporation. All right reserved started: 16:11:39 Package Execution on IS Server failed. Execution ID:4, Execution Status:4.
Below is the screen shot how I execute the SQL Server Agent job,
------------Updated error message------------
Below is the screen shot of the error message that are given while execution of the deployed package.
Errors are as follows:
1) Data Flow Task Error: There were errors during task validation.
2) Data Flow Task Error: OLE DB Destination failed validation and return error code 0XC020801C.
3) Data Flow Task Error: One more component failed.
4) Data Flow Task Error: SSIS Error Code
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER
The AcquireConnection method call to the connection manager "RESHMAJADHAV\SQLEXPRESS.Adventureworks2012" failed with error code 0XC0202009.
5) Package Error: SSIS Error Code DTS_E_OLEDBERROR. An OLEDB error has occured. Error Code: 0X80004005. An OLE DB record is available. source: "Microsoft SQL Server Native Client 11.0" Hresult: 0X80004005 Description:"Login failed for user 'NTSERVICE\SQLAgGENT$SQL_SERVER_EVALU'.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0X80004005 Description:"Cannot open Database" AdventureWorks2012"
requested by login. The login failed"
Is it because of the connection string
"Data Source=RESHMAJADHAV\SQLEXPRESS;Initial Catalog=AdventureWorks2012;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;"
That I have defined in environmental variables in Integration Service Catalog I am unable to open the database..?
Any help will be greatly apprecaiated...
Data Source=RESHMAJADHAV\SQLEXPRESS;User ID=XXXXXXX;Password=XXXXXXXXX;Initial Catalog=AdventureWorks2012;Provider=SQLOLEDB;
for the destination connection. I think job is not getting the end user name and password.
It might help. I f not can you please post the exact error message. I am no able to see anything form the picture..
Thanks

How to fix the error can not obtain the schema rowset DBSCHEMA_TABLES_INFO?

I'm trying to correct some errors on an SSIS job. That number of errors was 12 and know I got to 5
I am getting the following error message, which is in French.
[OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Impossible d'obtenir l'ensemble de lignes du schéma "DBSCHEMA_TABLES_INFO" pour le fournisseur OLE DB "SQLNCLI10" du serveur lié "serveur3". Le fournisseur prend en charge l'interface, mais retourne un code d'erreur lorsqu'elle est utilisée.". [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute phase and returned error code 0xC0202009
The error message translates to the following in English.
[OLE DB Source 1] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Can not obtain the schema rowset" DBSCHEMA_TABLES_INFO "for OLE DB provider" SQLNCLI10 "for linked server" server3. "Provider supports the interface, but returns a failure code when it is used. ". [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute stage and returned error code 0xC0202009.
How do I fix the error message?
Translated error message:
The error message that you added in the comment was in French. Using Google Translate, the error message translates to the following:
[OLE DB Source 1] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "Can not obtain the schema rowset" DBSCHEMA_TABLES_INFO "for OLE DB provider" SQLNCLI10 "for linked server" server3. "Provider supports the interface, but returns a failure code when it is used. ". [SSIS.Pipeline] Error: component "OLE DB Source" (1) failed the pre-execute stage and returned error code 0xC0202009.
The message implies that you are probably trying to query a Linked Server using SQL Server Native Client 10.0. I am going to guess that the linked server is pointing to SQL Server 2000 based on the searches on web.
Check the following:
Read the below Microsoft Connect website bug report on how to fix your issue.
Unable to query linked SQL Server 2000
Quote from website:
The issue here seems to be that the instcat version on your SQL 2000 server is out-of-date. Following the steps in KB 906954 (http://support.microsoft.com/kb/906954) should fix that.
Other links:
Other links that might help to resolve your issue:
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider
Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI10" for linked server "XXXXXX"
The links suggest creating the below stored procedure in master database and granting Execute permission to appropriate user account.
USE master;
GO
CREATE PROCEDURE sp_tables_info_rowset_64
#table_name SYSNAME
, #table_schema SYSNAME = NULL
, #table_type nvarchar(255) = NULL
AS
DECLARE #Result INT
SET #Result = 0
EXEC #Result = sp_tables_info_rowset #table_name, #table_schema, #table_type
GO
To run the procedure (one time only is needed)
USE master
GRANT EXEC ON sp_tables_info_rowset_64 TO PUBLIC
Steps to create a data source to connect to SQL Server instance from SSIS 2008 R2
Here are the steps to create a Data Source to connect to an SQL Server instance using Business Intelligence Development Studio (BIDS) 2008 R2.
On the BIDS project solution, right-click on the folder Data Sources and click New Data Source...
On the Data Source Wizard, click New... to create a new connection.
On the Connection Manager dialog, perform the following steps:
Select an appropriate Provider based on the SQL Server version that you would like to connect to. You will see only the providers that are installed on the machine.
For SQL Server 2000, select Microsoft OLE DB Provider for SQL Server
For SQL Server 2005 - 2008 R2, select Native OLE DB\SQL Server Native Client 10.0
For SQL Server 2012, select Native OLE DB\SQL Server Native Client 11.0
Enter the Server name or Instance name, for example MachineName\InstanceName
Select Windows authentication or SQL Server Authentication depending on how you would like to connect to the SQL Server instance. If you choose SQL Server Authentication, enter a valid user name and password.
Click Test Connection to make sure that the credentials are valid.
Select a database to connect.
Click OK
Click Next on Data Source Wizard. On the final step, give a proper name to the Data Source like OLEDB_AdventureWorks. OLEDB denotes the connection type and AdventureWorks denotes the database name. Click Finish.
The newly created data source OLEDB_AdventureWorks will show up under the Data Sources folder in the SSIS project.
To add the data source to the package, right-click on the Connection Manager tab that is displayed at the bottom of an SSIS package and then click New Connection From Data Source...
Select Data Source dialog will display all the available data sources on the SSIS project. Pick the ones that you would like to add to the package and click OK.
The new data source will appear on the package connection manager. You can now use the connection manager in your package tasks.
Other option:
Instead of creating data source, you can also directly create a Connection manager on the package itself. You right-click on the Connection Manager tab that is displayed at the bottom of an SSIS package and then choose the appropriate connection that you would like to create. This connection manager will be visible only to the package and not to the other packages in the SSIS project solution.
Word of advice:
Read the FAQ on how to post a question with enough information for others to answer.
Do not add the error messages in the comments. It is very hard to read and understand the message.
Always edit your question to explain the issue in detail or to add more information.
Translate the error message if it is not in English.

"Not enough storage" Error When Trying To Select Destination Table in SSIS

I am building an SSIS package and getting an error when setting "Name of the table or the view" in the OLE DB Destination editor.
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred.
Error code: 0x8007000E. An OLE DB record is available.
Source: "Microsoft SQL Native Client 10.0" Hresult: 0x8007000E
Description: "Not enough storage is available to complete this operation.".
Failed to open a fastload rowset for "[dbo].[MyTable]".
Check that the object exists in the database.
Exception from HRESULT: 0xC0202040 (Microsoft.SqlServer.DTSPipelineWrap)
But, the table is definately there.
What could be causing this error?
Try saving the package and exiting from BIDS. Then start again, and try fixing the destination component.
It's only complaining about the table because it was in the process of handling that table at the time of the Out of Memory exception. It has a one track mind about that - failure setting up table == table does not exist.