String in NTEXT column
could you put your code lines here?http://www.rad.pasfu.com
December 27th, 2010 4:54pm

No the string is always non empty. But when its being inserted into the SQL table, I get this error. The string Error_Row column in SSIS is nText and the corresponding SQL column its mapped to is XML data type.
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 4:56pm

strErrorDetails = "<row><field name=" & ControlChars.Quote & "error" & _ ControlChars.Quote & " value=" & ControlChars.Quote & ex.ToString.Trim & _ " " & strAttributeName.Trim & ControlChars.Quote & "/></row>" Finally 'add the xml output to the output row Row.ErrorRow = strErrorDetails Row.ErrorRow is of type nTEXT and strErrorDetails in a string.
December 27th, 2010 4:56pm

Ok I resolved this. One of the columns in the final XML was null. This was causing the whole thing to fail. I now catch that and change that to an empty string.
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 5:06pm

So last bit of the problem. After your line of code, the text in the back is not going in as string anymore, but is in bytes and unreadable. How do I fix that? Row.ErrorRow.AddBlobData(System.Text.Encoding.UTF8.GetBytes(strErrorDetails))
December 27th, 2010 5:09pm

change last line as below: Row.ErrorRow.AddBlobData(System.Text.Encoding.UTF8.GetBytes(strErrorDetails)) let me know feedbackhttp://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 5:14pm

this is because of AddBlobData and convert to UTF8, I suggest you to use DT_WSTR instead of DT_NTEXT, you can stored string in this column directly.http://www.rad.pasfu.com
December 27th, 2010 5:24pm

DT_WSTR is too small in my case. In some tables, I have around 300 columns and when I build my XML around them, it fills up quickly. Anything else you can suggest?
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 5:26pm

Excellent!! Thanks Reza!
December 27th, 2010 5:44pm

However, now I get an error inserting into the database as follows. The DB field Datatype is XML: OLE_DST_Auditing [857]] 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: "Unicode data is odd byte size for column 8. Should be even byte size.".
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 6:34pm

I have an NTEXT column in a SCRIPT output which needs to be filled in by a string that is created in the code. What is the most efficient way to do this? The reason for NTEXT is because it contains XML data about errored out rows. I would want to do this within the script itself instead of adding a derived column or any other transformation.
December 27th, 2010 6:39pm

I'm not clear about your question. do you have a script component with a NTEXT output column, and you want to fill it from script? if yes,you can use this way: Row.YourOutputColumnName="anything you want" let us know if you mean anything elsehttp://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 6:46pm

did you pass an empty string to AddBlobData?http://www.rad.pasfu.com
December 27th, 2010 6:48pm

I have an output column defined in the script component which is of type nText. In my script itself, I build some xml and want to insert that xml into the script component. The XML I build is in a string variable. When I do Row.nTextColumn = stringvarilable I get an error saying it cannot convert the string to a blob column. Whats the best way to do this and is this is correct?
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2010 6:49pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics