Re: bcp problem

From: JD (joeydba_at_yahoo.com)
Date: 12/14/04

  • Next message: Hayden Gill: "Can't script a job using SQL-DMO Script method if Job greater than"
    Date: Tue, 14 Dec 2004 14:47:19 -0600
    
    

    Have you looked at using a format file for your BCP command? BOL will
    explain how to use them.

    "Hans" <Hans@discussions.microsoft.com> wrote in message
    news:F46030CF-34BD-45F9-BF49-9E8868A3207F@microsoft.com...
    > I am trying to import data from a file. The file has entries like
    >
    > 1437 "PJ_001" 3 "PJ/001 "
    > 5746 "PJ_002" 3 "PJ/002 "
    >
    > while the table is defined as
    >
    > k int 4 nulls
    > f text 16 nulls
    > c int 4 nulls
    > p char 30 nulls
    >
    > When I use command
    >
    > bcp "MyDatabase.dbo.MyTable" in "D:\Development\MyDatabase\MyFile.txt" -c
    > -S"MyPc\MyInstance" -U"sa" -P"MyPass"
    >
    > I get error message
    >
    > SQLState = 22001, NativeError = 0
    > Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation
    >
    > on every entry. Can anybody explain why, or even better, how to get this
    > working???
    >
    > Thanks in advance!
    > Hans.


  • Next message: Hayden Gill: "Can't script a job using SQL-DMO Script method if Job greater than"

    Relevant Pages

    • Re: Data structure Internals Question
      ... > PK_col INT NOT NULL IDENTITY PRIMARY KEY, ... > filled the default 1 byte allocated for the null bitmap. ... > strcuture is missing a column compared to the table metadata, ... >> a bit in the null bitmap to represent NULLs in a non-existent ...
      (microsoft.public.sqlserver.programming)
    • Re: DTS bug (?): Data Driven Query Task incorrectly replaces empty strings with NULL.
      ... CREATE TABLE DDQ_NULL_DEST(col1 int, colNullableCharCol char(1) NULL) ... > can't have them all be NULL or all be empty strings. ... It seems to propagate *other* NULLs ...
      (microsoft.public.sqlserver.dts)
    • Re: DTS bug (?): Data Driven Query Task incorrectly replaces empty strings with NULL.
      ... CREATE TABLE DDQ_NULL_DEST(col1 int, colNullableCharCol char(1) NULL) ... > can't have them all be NULL or all be empty strings. ... It seems to propagate *other* NULLs ...
      (microsoft.public.sqlserver.server)
    • Re: Data structure Internals Question
      ... PK_col INT NOT NULL IDENTITY PRIMARY KEY, ... filled the default 1 byte allocated for the null bitmap. ... > the table has any variable-length columns or not. ... If the added column does not allow NULLs and has a DEFAULT value, ...
      (microsoft.public.sqlserver.programming)
    • Re: How block the insertion of NULLS in SQL Server 2000??
      ... So for example, this allows NULLs: ... (B int NOT NULL) ... > How block the insertion of NULLS in SQL Server 2000?? ... > I know that in Ms-Access 2000 there is this option in the setting options, ...
      (microsoft.public.sqlserver.server)