FIX: SELECT MAX from INT Column May Cause Access ViolationLast reviewed: December 19, 1997Article ID: Q116075 |
4.20
WINDOWS
kbbug4.20 kbprg kbfix4.21a.sp1
The information in this article applies to:
BUG# NT: 814 (4.2)
SYMPTOMSSelecting the MAX value from a column that is defined as INT NOT NULL and is the fourth column in a table may result in an access violation on SQL Server.
STATUSMicrosoft has confirmed this to be a problem in Microsoft SQL Server version 4.2. This problem was corrected in the latest U.S. Service Pack for SQL Server version 4.21a. For information on obtaining the Service Pack, please contact your primary support provider.
MORE INFORMATIONThe table may be wider than 4 columns, but MAX should be selected from the fourth column and columns 1-3 should be 4 bytes wide. Here is a brief script to demonstrate the problem:
use pubs go drop table t1 go create table t1(c1 int, c2 int, c3 int, c4 int) go declare @counter int select @counter = 0 while @counter < 400 begin insert t1 values(@counter,@counter,@counter,@counter) select @counter = @counter + 1 end go select max(c4) from t1 go |
Additional reference words: 4.20 TRAP D Windows NT
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |