BUG: Load Table May Fail If Created with Different ANSI_PADDING

Last reviewed: December 19, 1997
Article ID: Q170639
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 17012 (NT: 6.50)

SYMPTOMS

An attempt to load a table may fail with the following error message:

   Msg 8412, Level 16, State 3
   Schemas differ between source table '' and target table 'load_test'.
   Table load has been aborted for table 'load_test'.

This problem occurs if both of the following conditions are true:
  • The table has a nullable char or varchar column and was created under one ANSI_PADDING setting.
  • The table was dumped, dropped, and re-created from a script, but with a different ANSI_PADDING option set.

Notice in the error message that the State is 3 in this scenario. Other state values indicate true schema differences between the source and destination tables.

The above behavior will most commonly be seen if the following sequence of events has occurred:

  1. An ODBC-based tool, such as the Microsoft Access Upsizing Wizard, is used to originally create the tables

  2. The schema is scripted using SQL Enterprise Manager and used to re-create the table at a later point in time from a DB-Library based client application (such as ISQL or ISQL/w). ODBC applications set ANSI_PADDING on by default, whereas DB-Library clients do not typically have this option set.

WORKAROUND

When re-creating the table, add an explicit call to SET ANSI_PADDING ON or OFF as appropriate. If the table was originally created from an ODBC client and you are trying to re-create it from a DB-Library client, set the option ON. If you are trying to do the reverse, set the option to OFF.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 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: script schema DMO ::Script
Keywords : kbbug6.50 SSrvAdmin SSrvDB_Lib SSrvDMO SSrvProg SSrvTran_SQL kbprg kbusage
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.