How to Bulk Insert a raw file?

  • I would like to use a bulk insert to import data from a raw file into a SQL Server 2008 database. Could someone explaing to me how to set up the format file? I tried running the following in the command prompt:

    bcp CaseLevelData.dbo.MedParSpecial format nul -c -f C:\Temp\LoadFilesForProcessing\CaseLevelData\FormatFiles\MedParSpecial.fmt -T -S myservername

    but I'm getting the following error when I try to run it:

    [Bulk Insert Task] Error: An error occurred with the following error message: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.The bulk load failed. The column is too long in the data file for row 1, column 25. Verify that the field terminator and row terminator are specified correctly.".

  • When you say "raw file", are you referring to a file created by the Raw File Destination in SSIS? If so, you can't import this using BCP - it's a proprietary, binary format that can only be processed within SSIS.

    If you are using "raw file" in the context of a simple flat text file, the following article may be helpful:

    http://msdn.microsoft.com/en-us/library/ms191516.aspx

    Books Online is also a good reference for the BCP utility.

    hth,

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • yeah, the raw file was created with the raw file destination task. How would I create a bulk insert to insert from the Raw file? I have to set the format file to something right?

  • I'm acyually using the Bulk Insert Task editor in SSIS 2008.

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

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