BUG: BCP/BULK INSERT Into a View May Cause Defaults Defined in Base-table to be Ignored (249887)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q249887
BUG #: 57191 (SQLBUG_70)
SYMPTOMS
When using BCP or BULK INSERT to insert data into SQL Server through a view, defaults defined in the base table of the view may be ignored if the following conditions are met:
- The base table for the view has a nullable column with defaults.
- There is a view defined for the base table.
- BCP IN is done to the base table through the view.
- The rows that are being inserted through BCP have no entries for the column with defaults.
The preceding conditions result in the nullable column, with the default, becoming populated with NULLs instead of with the default value.
WORKAROUND
BCP in through a view is allowed only if one base table is affected. Hence, instead of BCP -ing in through a view, BCP directly into the base table.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbBug kbpending KB249887 |
---|
|