Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql bulk insert error

Status
Not open for further replies.

kporters

Programmer
Jan 11, 2002
21
US
I'm using Access as a front end app, and am setting up my data in SQL.

I'm trying to get Bulk Insert to work, the command I'm using is:

BULK INSERT sqltablemytablename from '\\server\directoryname\filename.txt' with ( FIELDTERMINATOR = '\0' ROWTERMINATOR = '\r' )

and the error is

Server: Msg 4866, Level 17, State 66, Line 1
Could not bulk insert because column too long in data file. Make sure FieldTerminator and RowTerminator were specified correctly.
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'STREAM' reported an error. The provider did not give any information about the error.
The statement has been terminated.

the filename.txt input file is a text file with no field delimiters, the record size is 384 characters. the SQL table is the correct size.

can someone enlighten me on why the data won't insert?

thanks in advance
-k
 
Try to use a format file to determine the columns format on your text file you can read about on BOL article called "Using Format Files" AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top