BUG: DATETIME Convert May Set NULL to Jan 1, 1900 12:00AM
Article ID: 186830
Article Last Modified on 11/14/2003
APPLIES TO
- Microsoft SQL Server 4.21a Standard Edition
- Microsoft SQL Server 6.0 Standard Edition
- Microsoft SQL Server 6.5 Standard Edition
This article was previously published under Q186830
BUG #: 17819 (SQLBUG_65)
SYMPTOMS
Any local variable of fixed length for which there is an implicit or
explicit conversion to SMALLDATETIME will inadvertently convert NULL to the
default date Jan 1, 1900 12:00AM.
A fixed length binary variable will also convert NULL to the default date
when the IMPLICIT conversion is to DATETIME.
WORKAROUND
To work around this problem, use variables of variable length rather than
fixed length.
STATUS
Microsoft has confirmed this to be a problem in SQL Server versions 4.2x,
6.0, and 6.5. We are researching this problem and will post new information
here in the Microsoft Knowledge Base as it becomes available.
Additional query words: Transact-SQL t-sql tran-sql trans-sql january
Keywords: kbbug kbpending KB186830