Re: error while using bcp...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: miron (nospam_miron.berlin2_at_verizon.net)
Date: 08/03/04


Date: Tue, 03 Aug 2004 00:26:18 GMT

John,

I would look at the format file, or carefully walk step by step if
formatting is specified interactively. From here it appeared bcp is
instructed to use field width narrower then the value sql server query
selected. A query like this can help to determine the offending row

select primary_key_column, datalength( column_name ) as actual_data_length
from <table_name> where datalength( column_name ) > "desired_value"

-- cheers
Miron.

"John P" <JohnP@discussions.microsoft.com> wrote in message
news:C86A0589-DE18-4801-9476-E51CD5EB65B7@microsoft.com...
> Hello,
>
> Im getting the following when trying to bcp out a query w/ a lot of fields
>
> Starting copy...
> SQLState = S1000, NativeError = 0
> Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Warning: Server
data (3046 bytes) exceeds host-file field length (0 bytes) for field (1).
Use prefix length, termination string, or a larger host-file field size.
Truncation cannot occur for BCP out
> put files.
>
>
> I can't seem to figure out why this is happening...has anyone seen this
message before or know what could be causing it?
>
> I'd appreciate any feedback...
>
> Thanks!
>
> John



Relevant Pages

  • Re: BCP Format Files
    ... >> Don't think I have ever used a format file for an extract. ... a query and you can use that to format the data. ... i never managed to import native format bcp files w/o a format file. ...
    (microsoft.public.sqlserver.programming)
  • Re: bcp problem
    ... You could try using a format file, where the column delimiters would be ... qualifiers be part of the delimiter and thus get stripped out. ... If you want to stick with bcp, then just try using the Bulk Insert Task, as ... > f text 16 nulls ...
    (microsoft.public.sqlserver.dts)
  • Re: Create Job to dump SP results into a text file.
    ... I am glad to hear that the osql works fine now. ... I use BCP to create a format file for the output (this could be ... ', type a name to generate the format file, I use ... create a table 'authorsx' to hold the result set of the stored ...
    (microsoft.public.sqlserver.programming)
  • Re: Create Job to dump SP results into a text file.
    ... > I am glad to hear that the osql works fine now. ... > 2) using BCP to save the content of this table to a tab limited log file ... ', type a name to generate the format file, I use ... create a table 'authorsx' to hold the result set of the stored ...
    (microsoft.public.sqlserver.programming)
  • Re: BCP Troubles
    ... The SQL server we are tying to BCP into is SQL 2000. ... > way I got it to work was to run BCP and have it create a ForMaT file. ... So it sounds like the first time BCP is not executed at ...
    (comp.databases.ms-sqlserver)