FIX: MIPS: Local Variable & Select Distinct May Trigger GP Fault
  
PSS ID Number: Q117517
Article last modified on 06-29-1995
 
4.21
 
WINDOWS
 

----------------------------------------------------------------------
The information in this article applies to:
 
  - Microsoft SQL Server version 4.21
----------------------------------------------------------------------
 
BUG# NT: 835 (4.21 - NTMIPS)
 
SYMPTOMS
========
 
Assigning a value from SELECT DISTINCT to a local variable in a trigger
will cause Access Violation on SQL Server for Windows NT on the MIPS-based
computers.
 
The variable can be of any type. The statement that causes the access
violation is:
 
   select distinct @X= c1 from table where c1 = value.
 
For example:
 
   create table tab1 (c1 int, c2 char(10))
   go
   create trigger tab1t on tab1 for update as
   declare @x int
   select distinct @x1 = c1 from tab1 where c1 = 2
   go
   insert tab1 values (1, "test1")
   insert tab2 values (2, "test2")
   go
   update tab1 set c2 = "test3"
 
The error message received at the workstation is:
 
   Language_Exec: Process 5 generated access violation: SQL Server
   is terminating DB-library process Dead - Connection broken.
 
This message implies that an access violation occurred for this process,
and the server has terminated this process or this workstation connection.
 
WORKAROUND
==========
 
Redesign the statement not to have the combination between distinct and
local variables.
 
For example: Select Distinct to a temp table, then in another query select
from the temp table to the local variable.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in Windows NT SQL Server
version 4.21 on MIPS-based computers. This problem was corrected in SQL
Server version 4.21a. For more information, contact your primary support
provider.
 
Additional reference words: 4.21 RISC general protection fault
KBCategory: kbprg kberrmsg
KBSubCategory: SSrvRISC SSrvWinNT
 
=============================================================================
 
Copyright Microsoft Corporation 1995.
