bcp problems

  • The following is two bcp scripts. The first one works. It is importing a single column file. The second one which imports a 2 column file goes to eoj but copies 0 records. What am I doing wrong. I've used a non-xml format file as well as an xml format file. No change. I've tried it on both 2005 SQL Server Express as well as 2005 SQL Server. I've tried it with and without the path. Same results. Can any one help?

    I've included the line of code that generates the xml format file.

    bcp "NPNPlus_GenericDrugs.dbo.PharmacyGenericGroups" in "E:\websites\PharmDrugGroups.csv" -Slocalhost\SQLEXPRESS -T -c

    bcp "NPNPlus.dbo.PharmacyGenericDrugs" in "E:\websites\PharmDrugs.csv" -fE:\websites\Drugs-c..xml -Slocalhost -T

    bcp NPNPlus.dbo.PharmacyGenericDrugs format nul -c -x -f Drugs-c..xml –t, -T

  • Hello

    Some information would be useful:

    * Can you post some sample data of the file?

    * Can you post the message returned by BCP?

    * Can you post your table structure?

    Greets

    Flo

  • The table:

    USE [NPNPlus_GenericDrugs]

    GO

    /****** Object: Table [dbo].[PharmacyGenericDrugs] Script Date: 03/06/2009 13:45:59 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [dbo].[PharmacyGenericDrugs](

    [DrugName] [varchar](250) NULL,

    [DrugGroup] [varchar](250) NULL

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    File sample:

    ACETAMIN 650 MG SUP ,A Drugs

    ACYCLOVIR 200 MG   ,A Drugs

    ALBUTEROL 0.5%      NEB,A Drugs

    ALBUTEROL 2 MG/5ML  SYP,A Drugs

    ALBUTEROL 2 MG      TAB,A Drugs

    ALBUTEROL 4 MG      TAB,A Drugs

    ALLOPURINOL 100 MG  TAB,A Drugs

    message:

    Starting copy...

    SQLState= HY000, NativeError = 0

    Error = [Microsoft][SQL NativeClient]Unexpected EOF encountered in BCP data-file

    0 rows copied.

    Network packet size : 4096

    Clock time Total : 1

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply