Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

error in bulk copy Expand / Collapse
Author
Message
Posted Wednesday, February 20, 2013 4:27 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, October 25, 2014 1:54 AM
Points: 108, Visits: 1,099
Hi

I want to test some changes in the structure of a table and see the plan,I exported the data in a text file using bulk copy,the table is about 400G and 120000000 records.

bcp DB.dbo.[Table] out "G:\sqlscript.txt" -c -T

after that I create the table in another test server ,using the primary structure of the table from Main server and the same collation

I imported the data in new table with this command

bcp Test.dbo.[Table2] in "G:\sqlscript.txt" -c -T -e G:\error.txt


but from 120000000 records ,it inserted just 1000000 records and in command prompt I have :

sqlstate =22005 , nativeerror=0 error = [microsoft][sql server native client 10.0]invalid character value for cast specification

and in error.txt file :

#@ Row 951577, Column 8: Invalid character value for cast specification @#

please help me
Post #1422024
Posted Wednesday, February 20, 2013 7:20 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Thursday, December 11, 2014 12:22 PM
Points: 1,446, Visits: 3,232
I would use -N option (native mode) for what you are doing instead of -c



The probability of survival is inversely proportional to the angle of arrival.
Post #1422075
Posted Saturday, February 23, 2013 2:33 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, October 25, 2014 1:54 AM
Points: 108, Visits: 1,099
Thanks a lot
It worked
Post #1423330
Posted Sunday, March 3, 2013 2:14 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, October 25, 2014 1:54 AM
Points: 108, Visits: 1,099

A gain I have problem with bcp in.It worked for that table but when I want to try it for another table I got this error in error file:

#@ Row 52, Column 2: String data, right truncation @#

This column is varchar,I checked the previous table and it dosen't contain any varchar column.how can I solve this ?
It took me a lot of time to export the data
Post #1425929
Posted Monday, March 4, 2013 1:12 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, October 25, 2014 1:54 AM
Points: 108, Visits: 1,099
I used format file and now it is inserting.

bcp DB.dbo.[Table] format nul -T -N -f t_n.fmt
Post #1426112
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse