BUG: Alias w/ Aggregates Can Cause Handled AV on 4.2x UpgradeID: Q150389
|
If a stored procedure is created that does an UPDATE statement and uses
alias names and table names intermixed in a query accompanied by aggregate
functions, the upgrade of a SQL Server version 4.21a server to version 6.0
may hang and a handled access violation (AV) will be seen in the error log.
The same stored procedure can be created and executed in both versions
4.21a and 6.0. The upgrade from 4.21a to version 6.5 completes
successfully.
Verify that there are no stored procedures fitting the above criteria that
would cause the upgrade to hang.
If the upgrade does hang, restore version 4.21a to the point where it is
ready to upgrade again. Then delete the stored procedure and recreate it
after the upgrade completes.
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 4.21a. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
An example of a stored procedure that would result in a handled access
violation is:
create table tab1
(col1 int,
col2 int,
col3 char (1))
go
create table tab2
(col1 int,
col2 int,
col3 char (1))
go
insert into tab1 values (10, 20, 'A')
go
insert into tab1 values (10, 20, 'B')
go
insert into tab1 values (30, 40, 'C')
go
insert into tab1 values (30, 40, 'D')
go
insert into tab2 values (10, 20, 'A')
go
insert into tab2 values (10, 20, 'B')
go
insert into tab2 values (30, 40, 'C')
go
insert into tab2 values (30, 40, 'D')
go
CREATE PROCEDURE testproc as
begin
update tab2
set tab2.col1 =
(select (max(tab2.col2) - sum (tt.col2))
from tab2 t, tab1 tt
where t.col3 = tt.col3)
CREATE PROCEDURE testproc as
begin
update tab2
set tab2.col1 = tab2.col2, tt.col1 = tt.col2
from tab21 t, tab1 tt
where t.col3 = tt.col3
end
CREATE PROCEDURE testproc as
begin
select (max(tab2.col2) - sum (tt.col2))
from tab2 t, tab1 tt
where t.col3 = tt.col3
end
Additional query words: exception sp sproc hung
Keywords : kbprg SSrvStProc kbbug4.21a
Version : 4.21a
Platform : WINDOWS
Issue type :
Last Reviewed: March 25, 1999