Quantcast
Viewing all articles
Browse latest Browse all 24688

Issue with Temp tables in SSIS 2012 with RetainSameConnection=true

Hello,

We have few packages written in 2008 and are being upgraded to 2012. Our package mostly uses temp tables during the process.  During initial migration, we faced issue with handling temp table in the OLE Db destination provider and found a solution for the same under 

usage of Temp tables in SSIS 2012

Most of our packages execute fine now. 

we came across a different issue recently. For one of our package, which merges 3 feeds into a temp table and then executes a stored procedure for processing, the package fails intermittently.

Below are properties of SSIS and its components, which you might be interested

* Retainsameconnection for the OLE Db connection manager set to True

* properties of OLEDB Destination 

AccessMode : SQL Command 
CommandTimeOut : 0
SQLCommand : Select * from #tmp

* using SSIS 2012 and SQL OLEDB Native Provider 11 (Provider=SQLNCLI11.1)

* one of the feed is 10MB

During investigation using profiler, found that though I use RetainSameConnection, I often  could see that more than one SPId is used during the scope of SSIS execution and when ever this happens, package fails with below error message 

An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E14  Description: "Statement(s) could not be prepared.".

An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E14  Description: "Invalid object name '#tmp'."

Now, Why SSIS uses a different SPId during its execution when RetainSameconnection is set to True (note : I have only one OLEDB connection in that package)? 

To simulate the issue, Instead of 10MB file, I used a 500KB file and execute the package twice and all went fine.

Is it because of 10 MB file taking long time to process causing the time out of that OLEDB destionation forcing the SSIS to go for another connection? but remember, CommandTimeout is set to infinite(0) for that OLEDB destination. 

Much appreciated your response. 




Viewing all articles
Browse latest Browse all 24688

Trending Articles