Received an invalid column length from the bcp client for colid 6

后端 未结 7 1951
别那么骄傲
别那么骄傲 2020-12-12 18:41

I want to bulk upload csv file data to sql server 2005 from c# code but I am encountering the below error -

Received an invalid column length from th

7条回答
  •  独厮守ぢ
    2020-12-12 19:08

    I faced a similar kind of issue while passing a string to Database table using SQL BulkCopy option. The string i was passing was of 3 characters whereas the destination column length was varchar(20). I tried trimming the string before inserting into DB using Trim() function to check if the issue was due to any space (leading and trailing) in the string. After trimming the string, it worked fine.

    You can try text.Trim()

提交回复
热议问题