Jan 5, 2009

SQL 2005 and Dates format

Yesterday I and my work college encounter a strange date format issue.
We have a SSIS on SQL 2005 which imports csv file to a DB. One of its fields was a date field, represented in the following format : dd/mm/yyyy.

The strange thing was that if the day number was less than 12 , ex. 5/2/2009 then the date was stored in DB as 2/5/2009. Different date. The import worked fine if the day number was above 12. 15/1/2009 was imported correctly.

We tried to change the regional settings on the SQL Instance machine, played with the date format, checked the collation of the DB. Nothing helped.

We solved our problem by changing the date format to : dd/mmm/yyyy (6/JAN/2009)

No comments: