title: SQL Import from Excel Spreadsheet
body: <p>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.</p>
  
  <p>When I try to import the data I get the following message(s):</p>
  
  <p><strong>Messages</strong></p>
  
  <ol>
  <li><p>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)</p></li>
  <li><p>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)</p></li>
  <li><p>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)</p></li>
  </ol>
  
  <p>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.</p>
  
  <p>Is the "NULL" messing up the process?</p>
  
  <p>Table Definition:</p>
  
  <pre><code>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,
      [eventcode2] [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]
  </code></pre>