Microsoft KB Archive/275622

From BetaArchive Wiki
Knowledge Base


FIX: Datetime Column Defaults Load Incorrectly During BULK INSERT

Article ID: 275622

Article Last Modified on 3/14/2006



APPLIES TO

  • Microsoft SQL Server 7.0 Standard Edition



This article was previously published under Q275622

BUG #: 57727 (SQLBUG_70)

SYMPTOMS

If a datetime column, which has a default value defined, has no incoming value during a BULK INSERT operation, the default value is inserted in the column. The column for that row may then have an incorrect value because the value inserted may not be the default value defined for that column.

WORKAROUND

To work around this problem, use any of these methods:

  • Use Data Transformation Services (DTS), Bulk-copy (BCP), or a distributed query to load the data file.


  • Remove the default constraint before you use the BULK INSERT and then add the default constraint back after the statement finishes.


WARNING: This method may allow other processes that access the table to insert rows with no default value for the duration of the process.


STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0


For more information, contact your primary support provider.


Additional query words: bulk copy wrong result bad data incorrect results

Keywords: kbbug kbfix KB275622