I need to store a large text created in the SSIS package Data Flow Script Component to the destination column with data type varchar(max). I use therefore as an Output Column text stream [DT_TEXT]. Inside the C# script I call the method
AddBlobData(Encoding.Default.GetBytes(LARGE STRING WITH LINE BREAKES))
All information is stored in the table, however the line breakes are not respected.
I tried different encoding like ASCII, UTF8. Also I have tried to add at the end of every line \r\n
, with no change in the result.
StringBuilder sb = new StringBuilder();
sb.AppendLine("This is the first line.");
sb.AppendLine("This is the second line.");
sb.AppendLine("This is the third line.");
DataBuffer.AddRow();
DataBuffer.VarcharMaxColumn.AddBlobData(Encoding.Default.GetBytes(sb.ToString()));
The result:
This is the first line. This is the second line. This is the third line.
There is a huge space between the lines, but not the line break I am expecting to see.
Does anyone knows how to fix this?