FIX: Stored Procedure with SELECT May Cause Access Violation
  
PSS ID Number: Q113067
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: 703 (4.21 - NTAlpha)
 
SYMPTOMS
========
 
On SQL Server for Windows NT on DEC Alpha-based computers, a stored
procedure may cause an access violation that terminates the client process
if it selects into a local variable with a SELECT that uses an ORDER BY
clause.
 
WORKAROUND
==========
 
Create a clustered index on the temporary table using the columns in
the ORDER BY. Then you can remove the ORDER BY and a table scan will
give you the correct results.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in SQL Server 4.21 for Windows
NT on DEC Alpha. This problem was corrected in SQL Server version 4.21a.
For more information, contact your primary support provider.
 
MORE INFORMATION
================
 
Below is a script that demonstrates the problem:
 
   use pubs
   go
   drop proc sp1
   go
   create proc sp1 as
   declare @v1 int
   create table #temp(
   c1     int)
   select @v1=c1
   from #temp order by c1
   go
   exec sp1
   go
 
Additional reference words: 4.21 Windows NT
KBCategory: kbprg kberrmsg
KBSubcategory: SSrvWinNT SSrvRISC
 
=============================================================================
 
Copyright Microsoft Corporation 1995.
