BUG: Default Using Global Variable GP Faults Server

Last reviewed: May 5, 1997
Article ID: Q97147

The information in this article applies to:
  • Microsoft SQL Server version 4.2 for OS/2
BUG# OS/2: 1648 (4.2)

SYMPTOMS

When inserting records into a table and using a default to fill in a column with a value derived from a system variable, SQL Server experiences a general protection fault (GP fault).

CAUSE

If a default of the following form is used to fill in values in a column, the server will GP fault:

   create default problem_default as @@spid

If values are specified for the column so that the default is not used to insert a value into the field, a trap will not occur. A default that produces a value derived from a system variable, such as

   create default problem_default as convert( char(10), @@spid )

will produce a trap.

WORKAROUND

If you want a record of the current @@spid, a trigger should be created on the table to update the inserted records with the desired @@spid. If you want to make record of the user inserting the record, you can use system functions such as USER_ID(), SUSER_ID(), and HOST_ID() within a default to identify the creator.

STATUS

Microsoft has confirmed this to be a problem in SQL Server versions 4.2 and 4.2a for OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: GP fault Transact-SQL fault trap
Keywords : kbbug4.20 kbbug4.20a kbprg SSrvServer SSrvTrans
Version : 4.2 4.2a
Platform : OS/2
Issue type : kberrmsg


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: May 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.