开发者

SQL Import from Excel Spreadsheet

I have a spreadsheet that I am importing that contains some test data for my application that I am building. I am using SQL Server 2008 and I amd doing the SQL Server Import and Export Wizard.

When I try to import the data I get the following message(s):

Messages

  1. Error 0xc02020c5: Data Flow Task 1: Data conversion failed while converting column "eventdate3" (78) to column "eventdate3" (219). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.". (SQL Server Import and Export Wizard)

  2. Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "eventdate3" (219)" failed because error code 0xC020907F occurred, and the error row disposition on "output column "eventdate3" (219)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)

  3. Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Data Conversion 0 - 0" (207) failed with error code 0xC0209029 while processing input "Data Conversion Input" (208). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard)

The eventdate3 column is currently of type datetime. In the spread sheet the first two rows have a value of "NULL" and rows 3 and 4 have a Date value.

Is the "NULL" messing up the process?

Table Definition:

CREATE TABLE [dbo].[teacherNotification](
    [finalId] [float] NULL,
    [schoolname] [nvarchar](255) NULL,
    [studentnumber] [int] NULL,
    [studentid] [float] NULL,
    [studentSectionId] [float] NULL,
    [lastname] [nvarchar](255) NULL,
    [firstname] [nvarchar](255) NULL,
    [classstartdate] [datetime] NULL,
    [coursename] [nvarchar](255) NULL,
    [TeacherId] [float] NULL,
    [TeacherSectionId] [float] NULL,
    [TeacherFN] [nvarchar](255) NULL,
    [TeacherLN] [nvarchar](255) NULL,
    [eventcode1] [float] NULL,
    [eventname1] [nvarchar](255) NULL,
    [eventdate1] [datetime] NULL,
    [eve开发者_开发知识库ntcode2] [float] NULL,
    [eventname2] [nvarchar](255) NULL,
    [eventdate2] [datetime] NULL,
    [eventcode3] [nvarchar](255) NULL,
    [eventname3] [nvarchar](255) NULL,
    [eventdate3] [datetime] NULL,
    [eventcode4] [nvarchar](255) NULL,
    [eventname4] [nvarchar](255) NULL,
    [eventdate4] [datetime] NULL,
    [eventcode5] [nvarchar](255) NULL,
    [eventname5] [nvarchar](255) NULL,
    [eventdate5] [datetime] NULL,
    [eventcode6] [nvarchar](255) NULL,
    [eventname6] [nvarchar](255) NULL,
    [eventdate6] [datetime] NULL,
    [eventcode7] [nvarchar](255) NULL,
    [eventname7] [nvarchar](255) NULL,
    [eventdate7] [datetime] NULL,
    [eventcode8] [nvarchar](255) NULL,
    [eventname8] [nvarchar](255) NULL,
    [eventdate8] [datetime] NULL,
    [eventcode9] [nvarchar](255) NULL,
    [eventname9] [nvarchar](255) NULL,
    [eventdate9] [datetime] NULL,
    [eventcode10] [nvarchar](255) NULL,
    [eventname10] [nvarchar](255) NULL,
    [eventdate10] [datetime] NULL,
    [emailAddress] [nvarchar](255) NULL
) ON [PRIMARY]


It seems to be a settings problem in the wizard. "Retain null values from the source as null values in the data flow" must be ticked, per this article:

http://ddkonline.blogspot.com/2009/07/fix-for-ssis-error-conversion-returned.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜