BUG: Error When Inserting NULL into Timestamp with ANSI_NULLS

Last reviewed: July 8, 1997
Article ID: Q170318
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 15818 (NT: 6.50)

SYMPTOMS

When attempting to insert the value 'NULL' into a timestamp column with ANSI_NULLS enabled, error 273 is returned:

   The user can't INSERT a non-null value into a TIMESTAMP column.
   Use INSERT with a column list or with a default of NULL for the
   TIMESTAMP column.

WORKAROUND

To work around this problem, do either of the following:

  • Disable ANSI_NULLS before inserting NULL into a timestamp column, as in the following example:

          create table tblNull ( iId int, timestamp )
          go
    

          set ansi_nulls off
          go
    

          insert tblNull values (1, NULL)
          go
    

    -or-

  • Use a column list on the INSERT statement and omit the timestamp, as in the following example:

          insert tblNull (iId) values (1)
          go
    

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.

MORE INFORMATION

You may encounter this problem when you attempt to use the Microsoft FoxPro Upsizing Wizard. The current version of the Upsizing Wizard does not allow you to disable the 'Add Timestamp' feature. For a technique to work around this problem, see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q139757
   TITLE     : FIX: Upsize Wizard Falsely Creates Timestamp Field on
               SQL 6.0


Additional query words: 6.50.201
Keywords : kbbug6.50 kbinterop kbusage SSrvGen SSrvTran_SQL
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Resolution 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: July 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.