Hi, I'm running vs 2017. sql 2017 std.
Long story but because my query is over 20k bytes long, I resorted to mapping it to a variable of type ado object and attempted to run it in the scripted data source you see below. I switched to a multi row result set in that var mapping even though
there is only one command. In 2 out of 3 tests on different location data, the script still went down on the 29,748th record. I do not believe nulls are any longer an issue.
The exception is shown below. I am running in debug under vs. Run 64 Bit Runtime is true in both the active (development) and development debugging config properties under project->properties->debugging. In the
data flow where this component is the data source, the defaultbuffermaxrows is 10,000 and the defaultbuffersize is 10,485,760. Engine threads is 10. The server has 32 gig of ram.
Does anybody know of some limit that might be biting me here? Or maybe a limitation when debugging? I noticed the x(86) path somewhere as I was perusing, I think it was an assembly path.
"System.Runtime.InteropServices.COMException (0xC0047020): Exception from HRESULT: 0xC0047020\r\n at Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSBuffer100.AddRow(IntPtr ppRowStart)\r\n at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.AddRow()\r\n
at Microsoft.SqlServer.Dts.Pipeline.ScriptBuffer.AddRow()\r\n at MyOutputBuffer.AddRow() in C:\\Users\\myid\\AppData\\Local\\Temp\\9\\vsta\\longstringofnumbersandletters\\BufferWrapper.cs:line 353\r\n at ScriptMain.CreateNewOutputRows()
in C:\\Users\\myid\\AppData\\Local\\Temp\\9\\vsta\\longstringofnumbersandletters\\main.cs:line 118" string
using System;
using System.Data;
using System.Data.OleDb;
//using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System.Data.SqlClient;
[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
IDTSConnectionManager100 connMgr;
SqlConnection sqlConn;
SqlDataReader sqlReader;
public override void AcquireConnections(object Transaction)
{
connMgr = this.Connections.ADO;
sqlConn = (SqlConnection)connMgr.AcquireConnection(null);
}
public override void PreExecute()
{
//these 5 lines retrieve the 20k byte query command
OleDbDataAdapter da = new OleDbDataAdapter();
DataTable dt = new DataTable();
da.Fill(dt, Variables.extractCommand);
DataRow dr = dt.Rows[0];
string a = dr["command"].ToString();
SqlCommand cmd = new SqlCommand(a, sqlConn);
sqlReader = cmd.ExecuteReader();
}
public override void CreateNewOutputRows()
{
while (sqlReader.Read())
{
try
{
MyOutputBuffer.AddRow();
MyOutputBuffer.locCode = sqlReader.GetString(0);
MyOutputBuffer.ID = sqlReader.GetInt64(1);
if (!sqlReader.IsDBNull(2)) { MyOutputBuffer.a = sqlReader.GetInt32(2); }
if (!sqlReader.IsDBNull(3)) { MyOutputBuffer.b = sqlReader.GetBoolean(3); }
if (!sqlReader.IsDBNull(4)) { MyOutputBuffer.c = sqlReader.GetInt32(4); }
MyOutputBuffer.d = sqlReader.GetInt32(5);
MyOutputBuffer.e = sqlReader.GetDateTime(6);
if (!sqlReader.IsDBNull(7)) { MyOutputBuffer.f = sqlReader.GetInt32(7); }
if (!sqlReader.IsDBNull(8)) { MyOutputBuffer.g = sqlReader.GetByte(8); }
if (!sqlReader.IsDBNull(9)) { MyOutputBuffer.h = sqlReader.GetString(9); }
MyOutputBuffer.i = sqlReader.GetDateTime(10);
if (!sqlReader.IsDBNull(11)) { MyOutputBuffer.j = sqlReader.GetInt32(11); }
if (!sqlReader.IsDBNull(12)) { MyOutputBuffer.k = sqlReader.GetInt32(12); }
MyOutputBuffer.l = sqlReader.GetInt32(13);
}
}
catch (Exception ex)
{
//I caught and copied the exception here in debug
}
}
public override void PostExecute()
{
sqlReader.Close();
}
public override void ReleaseConnections()
{
connMgr.ReleaseConnection(sqlConn);
}
}