Need help with bcp or Bulk insert...

  • Hi everyone, can someone help me??

    I need to load a file that is File.scp, it is just plain text, the field terminator are ','. I need to load it into a table, but I can not use DTS, so I found something that is bcp or bulk insert but it gives me an error:

    With BCP

    bcp Integra.dbo.temp_Reporte_shpmnt in F:\Cerveceria\adw_39_FPP\Sp\MasterPlanning\enterprise\scp\data\solver_data\op_data\Shipment.sol /U user /P password /S server /c /t","

    the error is:

    Server: Msg 170, Level 15, State 1, Line 1

    Line 1: Incorrect syntax near '.'.

    and when I use BULK INSERT:

    BULK INSERT Integra.dbo.temp_Reporte_shpmnt

    FROM 'F:\Cerveceria\adw_39_FPP\Sp\MasterPlanning\enterprise\scp\data\solver_data\op_data\Shipment.sol'

    WITH

    (

    FIELDTERMINATOR = ',',

    ROWTERMINATOR = '|\n'

    )

    but it gives me this error:

    Server: Msg 4860, Level 16, State 1, Line 1

    Could not bulk insert. File 'F:\Cerveceria\adw_39_FPP\Sp\MasterPlanning\enterprise\scp\data\solver_data\op_data\Shipment.sol'

    I thought that it was the extension of the file and changed it to C:\shipment.txt

    but it gives me the same error.

    Could someone help me?? please???

    Thanks a lot to all

    Ana


    Ana

  • I had a similar issue. Turned out I needed to grant permissions to the directory I was grabbing the data from to match the same login I used for the SQL service.

  • Pls don't cross post. This is being answered in another thread. We check all the forums.

    Steve Jones

    steve@dkranch.net

  • Sorry Steve, I thaught that my post didn´t arrive, because my connection failed.

    😀 please sorry I didn´t mean it

    HAve a great day

    Ana


    Ana

  • np. just informing you. We check all forums on this site, so a single post here works.

    Steve Jones

    steve@dkranch.net

Viewing 5 posts - 1 through 4 (of 4 total)

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