INF: SELECT INTO or Trans Mgr Can Unexpectedly Update NULL ColLast reviewed: March 18, 1997Article ID: Q134820 |
4.20 4.21
WINDOWS
kbprg kbcode
The information in this article applies to:
SUMMARYNULL column values may be updated when you use SQL Transfer Manager or the SELECT INTO statement to move data, due to a nullable user-defined data type having a future-only default binding at the source. This is the expected behavior because the tables you are creating use the defaults as bound.
MORE INFORMATIONWhen SQL Transfer Manager generates the creation script for the destination, it first creates the default data types, then any defaults that need to be bound to the user-defined data types; it then binds them to the data types and creates the tables. SELECT INTO creates the new table from current settings which show the user-defined data type as having a default bound to it. In the following scenario, the data movement causes the firing of the user-defined default, replacing NULL values with the default value:
Source
Destination
Work AroundIn order to move data which falls into the 'future only' scenario without modifying the NULL values, you need to generate scripts from the SQL Object Manager. Modify the scripts so the defaults are not bound, then create the new objects at the destination. Use SQL Transfer Manager, but do not include drops to move the data. By not including drops, you avoid the recreation of the objects which you have previously completed. Once the data is moved, bind the defaults accordingly. For the SELECT INTO case, you need to identify the user-defined data type bindings and unbind them before you perform the command. Be sure you replace the bindings correctly after the SELECT INTO operation is complete. You should place the database in single user mode while you complete the process so other data modifications that depend on the default are not inadvertently affected.
|
Additional reference words: 4.20 4.21 bcp
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |