Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 bcp in truncates data

Author  Topic 

ppocius
Starting Member

2 Posts

Posted - 2006-02-25 : 12:14:53
Hello, I have a bcp script that is being used to insert data into a table. The problem is that if the input data for a particular field is larger than is specified by the table field, the insert occurs with the data truncated to match the table field size. Is there a way to prevent bcp from truncating the data, and just reporting the row as an error?

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2006-02-25 : 17:46:51
Try setting maxerrors (-m) to 0. For bulk insert, the default maxerrors is 10, so it might be the same for bcp.
Go to Top of Page

ppocius
Starting Member

2 Posts

Posted - 2006-02-28 : 09:16:37
Thanks for the reply. I tried setting the maxerrors to 0, but the rows that are truncated are not being treated as errors by bcp, and thus are not being stopped.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-28 : 09:53:39
Are you using a Format File? If not might be worth a try (but I don't know for sure that that will constrain the data)

Kristen
Go to Top of Page
   

- Advertisement -