nvarchar(MAX) issue when inserting with sqlbulkcopy from datatable object

  • Hello all, I was wondering if anyone has stumbled upon the issue that I'm facing.

    I try to use SqlBulkCopy in C# in order to send a DataTableObject to the SQL Server (2008 & 2016 versions, both of them are used). 
    One of the fields (columns) in the DataTable object is of type string and in many cases can have a length of  way more than 4000 characters. 
    Now in the database the respective field is of type NVarchar(MAX) and in the DataTable object, the field is not truncated. It has the complete value. 
    When the insert operation takes place however, I get an error stating that the string would be truncated and the execution stops. 
    Any ideas regarding the above ? 
    If you need any further details, please let me know.

    Thank you in advance.

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply