Hi,
Please check below codes with error of freebcp -F option, which is not giving the desired results. In below example we are trying to restore the table of (MS SQL server 2012) from flat file as source. The said flat file is having two rows as header so we want to start from 3rd row, however the option fails to do so and considers the first two row while restoring.
And these said columns are declared as money datatype in SQL, so due to unexpected text with header line its getting failed.
freebcp dbo.dev01_temp in /test/data/fd/f1.dat -F2 -f/test/data/da_bcp.fmt -SSIMA -Ppsd -Utest -e /test/logs/bcp_error.txt
Starting copy...
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20050, Level 4
Attempt to convert data stopped by syntax error in source field
Msg 20088, Level 3
I/O error while writing bcp error file
1672 rows copied.
---------------------------------------------------------------
linux:white:/test/scripts> more /test/data/fd/f1.dat | wc -l
1674
linux:white:/test/scripts> more /test/logs/bcp_error.txt
#@ data conversion error on host data file Row 1 Column 23 #
#@ data conversion error on host data file Row 1 Column 27 #
#@ data conversion error on host data file Row 1 Column 28 #
#@ data conversion error on host data file Row 1 Column 31 #
#@ data conversion error on host data file Row 1 Column 32 #
Regards,
Vasanth Sengunthar
Accenture | India, Mumbai Delivery Centre
M: +91 8655274310
________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
______________________________________________________________________________________
www.accenture.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.