Export To Database Table Error - sql-server

hope someone can give me a tip on this one. I'm trying to export query results from a database in one server to a table in a database in another server. The Export Wizard transferred a couple hundred thousand rows and then threw the errors below:
Errors:
Error 0xc0202009: Data Flow Task 1: 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: "Protocol error in TDS stream".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Protocol error in TDS stream".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Protocol error in TDS stream".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Communication link failure".
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "TCP Provider: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
".
(SQL Server Import and Export Wizard)
Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - Query" (1) 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.
(SQL Server Import and Export Wizard)

Protocol error in TDS stream can be attributed to perhaps a flaky network connection or an isolated network jam. There may be a networking issue between Source and Destinaion.TDS stands for Tabular Data Stream and is the underlying protocol that SQL Server uses to return results to clients. The problem is with SQL Server or with the network communications. Possibly a faulty network card in one of the computers or an issue with the networking hardware in-between them. Check the event logs on both computers for networking errors at the OS level. Also check firewall setting if you are using load balancing. Transferring big table over slow network will cause problem.
If you are using linked-server queries then try explicitly casting VARCHARs, e.g., CAST(fieldname AS VARCHAR(30)) AS FIELDNAME. Sometime adding the CAST eliminate the problem.
Also give a try by following below.
The issue is solved when the Network Protocol used to connect to the source SQL Server is changed from TCP/IP to NamedPipes. Basically, an alias for the source is created on the destination server using the below steps.
Go to Start--> All Programs--> Microsoft SQL Server 2008--> Configuration Tools --> SQL Server Configuration Manager
Expand the node SQL Native Client 10.0 Configuration
Right click on "Aliases" and then select "New Alias..."
Provide the IP address of the Source SQL server against the "Server" field and specify the Source server name against the "Alias Name" field.
Choose the protocol as "NamedPipes" and click OK
There was a bug which was causing TDS error, so make sure that you have the latest updates/patches/hotfix for you SQL server.

Related

SSMS export to CSV trouble

I'm exporting data from SSMS as a CSV, I'm checking my work by downloading the data again, but the second time around (and when using different data) I'm getting the below errors in export wizard. It had been working previously, but now every time I attempt the export these errors pop up. Any ideas for fixing this?
Error 0xc0202009: Data Flow Task 1: 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: "Protocol error in TDS stream". An
OLE DB record is available. Source: "Microsoft SQL Server Native
Client 11.0" Hresult: 0x80004005 Description: "Protocol error in TDS
stream". An OLE DB record is available. Source: "Microsoft SQL Server
Native Client 11.0" Hresult: 0x80004005 Description: "Communication
link failure". An OLE DB record is available. Source: "Microsoft SQL
Server Native Client 11.0" Hresult: 0x80004005 Description: "TCP
Provider: An existing connection was forcibly closed by the remote
host. ". (SQL Server Import and Export Wizard) Error 0xc0047038:
Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The
PrimeOutput method on Source - Query 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.
(SQL Server Import and Export Wizard)

SSIS Data Flow Task Errors : SSIS Error Code DTS_E_OLEDBERROR and SSIS Error Code DTS_E_PRIMEOUTPUTFAILED

In my Data Flow Task (DFT ), I have OLE DB Source and Destination . In connection manager, my connection is OLE DB too.
Source is pulling 80000 records and loading in Desti. Simple package.
My Package is breaking on OLE DB Source.
The point to note is : It loads 53769 records very fine. But at the end it breaks on OLE DB Source.
Error:
[OLE DB Source [235]] 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: "Protocol error in TDS stream". An
OLE DB record is available. Source: "Microsoft SQL Server Native
Client 11.0" Hresult: 0x80004005 Description: "Communication link
failure". An OLE DB record is available. Source: "Microsoft SQL
Server Native Client 11.0" Hresult: 0x80004005 Description: "Shared
Memory Provider: No process is on the other end of the pipe.
[SSIS.Pipeline] Error: 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.
Can anyone help me please to solve this error?
This is my production environment.
Communication link failure
Shared Memory Provider: No process is on the other end of the pipe
The error messages above imply that there may be some network issues between the servers or the machine resources (especially RAM) are not able to handle the data.
You can try to change the adjust the data flow task buffer size.
Or you may try to load data in chunks, you can refer to the following article for a step-by-step guide:
SQL OFFSET FETCH Feature: Loading Large Volumes of Data Using Limited Resources with SSIS
I fixed it changing the Provider from SQL Server Native Client to Microsoft OLEDB Provider for SQL Server - it worked like a charm.

Cannot execute SSIS package in SQL Server 2016

I've seen this posted several times, but none of the fixes are working from my instance. I'm using SSDT 2015 to create the package and deploying to a network server using SQL Server 2016. The package target server version is set to SQL Server 2016 and I've changed the run time from 64 to 32 bit (not sure if this is needed, but listed as a fix for this issue). The connection managers are using my local server (different from the server the package is being executed from) and the network server where the package is being deployed. I'm able to successfully run the package in SSDT 2015, but when deployed to the server I get the errors below stating that the connection to my local server could not be established. I the validation of the connection and the data flow to delay validation and the first two tasks run, but again, it cannot connect to my local. Since I'm running the package with my credentials, I'm not sure why it cannot connect. I am a system admin for both Server instances and I've ensured that my login has ssis_admin role assigned on SSISDB. Any assistance would be greatly appreciated.
Data Flow Task:Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "localDB\SQL2016.Local" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
ApplicationDataETL: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: "Login timeout expired".
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: "SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. ".
Just to update everyone, this was issues that had issues and they had their issues. First, the Integration Services on the network server had been stopped due to logon error, first major issue. Second, in order to allow the network server to have access to my local server, I had to open the configuration manager on my local SQL instance and enable TCP/IP under the configuration settings for my 2016 instance. At this point, I needed to run netstat on the command prompt using my SQL Server Instance ID to determine if it is listening to port 1433. To ensure remote access, I then had to add rules to my firewall to allow TCP 1433, UDP 1434, sqlservr.exe, and sqlbrowser.exe. Once this was all completed, I was then able to connect to my local server through ssms on the network server. Using the proxy account I created for SQLAgent, I the job was then able to process successfully.

TCP Provider: The semaphore timeout period has expired in SSIS

Sometimes during loading data in SSIS from SQL Server to SQL Server 2016 (using Data Flow) I get following errors:
SE [[209]] 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: "Communication link failure". An OLE DB record is
available. Source: "Microsoft SQL Server Native Client 11.0"
Hresult: 0x80004005 Description: "TCP Provider: The semaphore timeout
period has expired. ".
[SSIS.Pipeline] Error: SE failed the pre-execute phase and returned
error code 0xC0202009.
I cannot find any pattern when I get this. Anyone had the same problem and solved it?
I had this elusive problem before and searched for it, the only notion on MSDN forum and SO question "how to resolve DTS_E_OLEDBERROR. in ssis". In a nutshell - issue is related to high load of SQL server or its runtime environment. In my case, error disappeared after adding more RAM to SQL server and configuring TCP window = 32767; however, I am not convinced it was the cure.

DTS_E_OLEDBERROR. Error code: 0x80004005.Difference between SQl Native client and oledb provider for sql server

There was a communication link error while I was using SQL Server Native Client 10 in an SSIS Data Flow component.
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 10.0" Hresult: 0x80004005
Description: "Communication link failure".An OLE DB record is
available. Source: "Microsoft SQL Server Native Client 10.0"
Hresult: 0x80004005 Description: "TCP Provider: The specified network
name is no longer available.
So I changed from SQL Server Native Client 10 to Microsoft OLEDB Provider for SQL Server, hoping that it would run fine. This time got an error as shown below:
[Transacn_Tbl1[737]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE
DB error has occurred. Error code: 0x80004005. An OLE DB record is
available. Source: "Microsoft OLE DB Provider for SQL Server"
Hresult: 0x80004005 Description: "Unspecified error occurred on SQL
Server. Connection may have been terminated by the server.".
[Transacn_Tbl1[737]] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "OLE DB Destination
Input" (750)" failed because error code 0xC020907B occurred, and the
error row disposition on "input "OLE DB Destination Input" (750)"
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.
What is the difference between these 2 providers? Which one should I use?
I ran into this issue after releasing a new SSIS project to the production environment.
At first, I was able to validate the package with success, but when I tried to execute the package, I got the DTS_E_OLEDBERROR. Error code: 0x80004005. message.
I tried to validate the package with the servername and password variables set to sensitive, but in this case the validation failed as well.
After setting the environment variables back to non-sensitive again and inserting the environment variable values, I was able to validate and execute the package.
To me it seems like in some cases the metadata in the SSISDB gets corrupted, but unfortunately I've not been able to point down the source of this issue.
I hope this will help someone. I've went through a lot of debug scenarios before I ended up with this (rather unsatisfying) solution.
It looks like you have to resolve this issue, you must change the permissions for the Temp directory of the SQL Server Agent Service startup account. Grant the Read permission and the Write permission to the SQL Server Agent proxy account for this directory.
http://support.microsoft.com/kb/933835
I changed connection to Provider=SQLNCLI11.1 and executed
successfully with parameters.
DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005
This obscure error can also mean something as benign as the OLE provider cannot find the expected Excel Worksheet.
I recently came across this error in an SSIS project and after several hours trying to track down what I believed was some configuration issue, it turned out to be the end user had simply changed the name of a Worksheet in the Excel data source.
Microsoft Messaging FTW!

Resources