load data conversion error

  • I have a table that looks like this;

    CREATE TABLE MyTable(

    [file_id] [int] IDENTITY(1,1) NOT NULL,

    [file_path] [varchar](100) NULL,

    [file_name] [varchar](30) NULL,

    [file_create_date] [datetime] NULL,

    [file_modified_date] [datetime] NULL,

    [file_type] [nvarchar](30) NULL,

    [file_size] [decimal](28, 2) NULL,

    [file_number_rows] [int] NULL,

    [error_flag] [bit] NULL

    and I also have a log file that looks like this;

    C:\TEMP\watch_dir\Visio.vsd,Created,11/11/2010 5:13:38 PM

    C:\TEMP\watch_dir\Visio.vsd,Renamed,,myVisio.vsd,11/11/2010 5:13:46 PM

    C:\TEMP\watch_dir\NewBCase,Created,11/11/2010 5:13:53 PM

    C:\TEMP\watch_dir\NewBCase,Created,11/11/2010 5:13:53 PM

    C:\TEMP\watch_dir\NewBCase,Renamed,,myBC,11/11/2010 5:14:04 PM

    C:\TEMP\watch_dir\BitmapImage.bmp,Created,11/11/2010 5:14:10 PM

    C:\TEMP\watch_dir\BitmapImage.bmp,Renamed,,img.bmp,11/11/2010 5:14:13 PM

    C:\TEMP\watch_dir\Text.txt,Created,11/11/2010 5:14:24 PM

    C:\TEMP\watch_dir\Text.txt,Renamed,,myTxt.txt,11/11/2010 5:14:28 PM

    now when I try to run this bulk insert statement,

    BULK INSERT MyTable FROM 'C:\Users\...\logger.txt' WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = ':')

    I am getting this error...does anyone know how I can fix this?

    "Msg 4864, Level 16, State 1, Line 1

    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1 (file_id)."

    Thanks

  • what are the columns you have in your .txt file?

    can you post sample data from your text file?

    Thats for sure a datatype mismatch error or datatype size issue.

    [font="Tahoma"]
    --SQLFRNDZ[/url]
    [/font]

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

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