79579562

Date: 2025-04-17 15:16:15
Score: 1.5
Natty:
Report link

Found the answer, it took a while to find, but here is the reason the Excel Source does what it does.

From page: https://learn.microsoft.com/en-us/sql/integration-services/load-data-to-from-excel-with-ssis?view=sql-server-ver16

"The Excel driver reads a certain number of rows (by default, eight rows) in the specified source to guess at the data type of each column. When a column appears to contain mixed data types, especially numeric data mixed with text data, the driver decides in favor of the majority data type, and returns null values for cells that contain data of the other type. (In a tie, the numeric type wins.) Most cell formatting options in the Excel worksheet do not seem to affect this data type determination."

This is a very useful feature to have, if you don't want to change the perceived data type of the Excel spreadsheet.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: TimC