BUG: Default Using Global Variable GP Faults ServerLast reviewed: May 5, 1997Article ID: Q97147 |
The information in this article applies to:
SYMPTOMSWhen 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).
CAUSEIf 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 @@spidIf 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.
WORKAROUNDIf 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.
STATUSMicrosoft 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |