This is a discussion on Displaying truncated rows during bcp within the Sybase forums, part of the Database Server Software category; --> Hi, I'm bcp'ing in a large volume of data with this command : bcp database..BcpTable in datafile -Uusername -Ppasswd ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I'm bcp'ing in a large volume of data with this command : bcp database..BcpTable in datafile -Uusername -Ppasswd -SSERVER -c -t\\t -r\\n -e bcp.err and I get the following message: Starting copy... 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. .... 1257 rows copied. Clock Time (ms.): total = 1 Avg = 0 (1257000.00 rows per sec.) Is there any way for me to see which rows were truncated before insertion into the table? They don't show up in the errors file I specified. Please cc: femi@cnet.com when sending a response. Thanks, Femi |
| |||
| 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? |
| ||||
| I've been able to figure out which rows had the problem using a batch size of 1, and obtaining the line #s at which the warning occurred. Thanks a lot. Femi lucky_justin69@yahoo.com (Neal) wrote in message news:<498321de.0311120812.64f0123@posting.google.c om>... > 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? |