BUG: AV on Cursor with Arithmetic Operation and ORDER BY ClauseID: Q177007
|
SQL Server generates an access violation (AV) when declaring a dynamic cursor that contains an arithmetic operation on a column that is contained in an ORDER BY clause. The AV does not occur if the arithmetic operation is performed on the first column in the ORDER BY clause. However, performing the arithmetic operation on any other column position in the ORDER BY clause does cause the AV.
To work around this problem, do either of the following:
Microsoft has confirmed this to be a problem in SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
The following script will reproduce the access violation:
CREATE TABLE dbo.ftt (
ftt_date datetime NULL ,
ftt_amount smallmoney NULL ,
ftt_vat smallmoney NULL ,
ftt_int int
)
GO
declare test cursor
for
select (ftt_amount+ftt_vat)
from ftt
order by ftt_date, (ftt_amount+ftt_vat), ftt_int
open test
close test
deallocate test
go
drop table ftt
go
order by (ftt_amount+ftt_vat), ftt_date, ftt_int
Additional query words: DB-Library Process Dead Connection Broken
Keywords : kbusage SSrvTran_SQL kbbug6.50
Version : WINNT:6.5
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 20, 1999