[dba-SQLServer] Bulk Insert Problem

Arthur Fuller fuller.artful at gmail.com
Tue Jun 17 06:39:56 CDT 2008


I'm exploring Bulk Insert for the first time, following the code in Paul
Neilson's SQL Bible.

<sql>
USE [TestBulkInsert]
GO
CREATE TABLE [dbo].[AddressStaging](
    [ID] [int] NULL,
    [Address] [varchar](500) NULL,
    [City] [varchar](500) NULL,
    [Region] [varchar](500) NULL,
    [PostalCode] [varchar](500) NULL,
    [GUID] [varchar](500) NULL,
    [Updated] [datetime] NULL
) ON [PRIMARY]
GO

BULK INSERT AddressStaging
    FROM 'C:\Address.csv'
    WITH (FIRSTROW = 1, ROWTERMINATOR = '\n')
</sql>

This results in the error MESSAGE:

Bulk load: DataFileType was incorrectly specified as char. DataFileType will
be assumed to be widechar because the data file has a Unicode signature.
Bulk load: DataFileType was incorrectly specified as char. DataFileType will
be assumed to be widechar because the data file has a Unicode signature.
Msg 7339, Level 16, State 1, Line 1
OLE DB provider 'BULK' for linked server '(null)' returned invalid data for
column '[BULK].Updated'.

The Address.csv file is the sample file in the Adventureworks directory.
Anyone know what I'm doing wrong and how to make it work correctly?

Thanks!
Arthur



More information about the dba-SQLServer mailing list