Import Excel file - NULL date field

  • I have an Excel file that I am importing into a SQL Server 2005 database. One of the xls fields is a date field with a few dates in it, but mostly contains NULL values. When I import the file into SQL 2005, ALL rows for that date field come in as NULL. It drops the good dates.

    As a test, I sorted the dates to the top of the xls file prior to importing into SQL, and the dates went in fine.

    I can't be certain, but I am pretty sure this did not occur in SQL 2000.

    How can I make SQL quit dropping the values in this field?

    Thanks.

    Joel

  • This is commonly seen in Excel even in SQL 2000 due to how it samples the incoming data to determine the field type. I have had to go as far as making file CSV or TAB to get these to com out right. There is, as I recall, a key in the registery to increase the sample but forget what it is.

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

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