Jim Geissman (jim_geissman@countrywide.com) writes:
[quoted text, click to view] > I am trying to bulk insert a text file. The file has fixed-length fields
> with no field terminators. BOL says that field terminators are only
> needed when the data does *not* contain fixed-length fields, which
> implies they are optional -- so I made a format file without any (two
> consecutive tabs with nothing between them). The following message
> resulted:
>
> Server: Msg 4827, Level 16, State 1, Line 1
> Could not bulk insert. Invalid column terminator for column number
> 1 in format file
>
> That sounds like I am required to have some sort of terminator in the
> format file, even though there aren't any in the data file.
> Unfortunately, the documentation on bcp/bulk copy and format files does
> not directly address this point, and I would appreciate some help.
You must specify the separator in quotes, but it can be the empty
string, "". The tabs does not mean anything to BCP, as far as I know.
At least it never complain about lack of tabs in my format files.
[quoted text, click to view] >BTW, putting '""' (empty string) for the terminator also leads to errors,
>with the first field overflowing -- bulk insert can't figure out where
>it ends.
What about posting:
o CREATE TABLE statement for your table.
o The format file. (The one with "" in it.)
o A sample file to bulk-load.
That makes it a little easier to have a guess of what is going on.
If the data file is more than 75 characters wide, you are probably
better of putting it an attachment.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se
Books Online for SQL Server SP3 at