![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello, I don't know how to find out which row was truncated before it is inserted into the table. If the column being truncated is character, the row will still be inserted because the truncation is considered a warning. Feature Request number 236085 was filed to record the row/column being truncated. No customer support cases are associated with this request and consequently it has a very low priority. One way to find out which row was truncated after it was inserted into the table is to use a batch size of 1: % bcp tempdb..t1 in test.txt -Usa -P -c -eerr.txt -b 1 Starting copy... Batch successfully bulk-copied to SQL Server. Batch successfully bulk-copied to SQL Server. CSLIB Message: - L0/O0/S0/N36/1/0: cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow. Batch successfully bulk-copied to SQL Server. Batch successfully bulk-copied to SQL Server. 4 rows copied. Clock Time (ms.): total = 1 Avg = 0 (4000.00 rows per sec.) Since the truncation warning appears before the third success message, I know the third row was the one that was truncated. Another method would be to use the "-F" and "-L" parameters to cut the data into chunks and narrow down the problematic row. Maybe other users have different methods? |
![]() |
| Thread Tools | |
| Display Modes | |
| |