[dba-SQLServer] Bulk Insert Problem

Gustav Brock Gustav at cactus.dk
Tue Jun 17 06:47:06 CDT 2008


Hi Arthur

>From the error message it sounds like varchar is expected to be replaced with nvarchar in the table definition.

/gustav

>>> fuller.artful at gmail.com 17-06-2008 13:39 >>>
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