请教:SqlDumpExceptionHandler: 进程 230 发生了严重的异常 c0000005 EXCEPTION_ACCESS_VIOLATION

wangdehao 2006-07-04 11:28:26

--建立测试环境
Create Table #table1(xid int,xNum varchar(10))
--插入数据
insert into #table1
select 1 ,'A' union all
select 2,'C' union all
select 2,'B' union all
select 3,'C' union all
select 3,'D' union all
select 4, '0'



--建立测试环境
Create Table #table2(xid int,xNum2 varchar(10))
--插入数据
insert into #table2
select 2,'H' union all
select 3,'F' union all
select 1 , 'I' union all
select 1, 'K'

/****
Result:
xID xNum xNum2
1 A I
1 Nul K
2 C H
2 B Null
3 C F
3 D Null
4 o Null
****/

select id = identity(int,1,1),xid,xnum into #table11 from #table1
select id = identity(int,1,1),xid,xnum2 into #table21 from #table2

---这地方:
select a.xid,a.xnum,b.xnum2 from #table11 a left join #table21 b
on a.xid=b.xid and (select count(*) from #table11 where xid=a.xid and id<a.id)=(select count(*) from #table21 where xid=b.xid and id<b.id)

union

select a.xid,b.xnum,a.xnum2 from #table21 a left outer join #table11 b
on a.xid=b.xid and (select count(*) from #table21 where xid=a.xid and id<a.id)=(select count(*) from #table11 where xid = b.xid and id<b.id)

----上面的没问题:但是用right join的话
select b.xid,a.xnum,b.xnum2 from #table11 a right outer join #table21 b
on a.xid=b.xid and (select count(*) from #table21 where id< b.id )>0
便会出现
ODBC: 消息 0,级别 19,状态 1
SqlDumpExceptionHandler: 进程 230 发生了严重的异常 c0000005 EXCEPTION_ACCESS_VIOLATION。SQL Server 将终止该进程。



错误,请问为什么会这样呢?




...全文
1146 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangdehao 2006-07-04
  • 打赏
  • 举报
回复
看来Haiwer(海阔天空)的sqlserver也没打sp4补丁 ^_*
wangdehao 2006-07-04
  • 打赏
  • 举报
回复
刚才查了下,数据库是sp3补丁,在http://support.microsoft.com/kb/839458/这也提到这个错误,不过不是由right join 引起的,也是建议打sp4补丁
zlp321002 2006-07-04
  • 打赏
  • 举报
回复
我测试也没有问题.SQL sever 2005
zjcxc 元老 2006-07-04
  • 打赏
  • 举报
回复
这是一个BUG

刚刚找到了sp3的环境, 在sql 2000+sp3下也有这个问题, 看来要解决的话, 必须升级到sql sp4或者sql 2005了.
zjcxc 元老 2006-07-04
  • 打赏
  • 举报
回复
2000 补丁装到sp4也没有问题.

没有装补丁就有问题.

没有环境, 不知道sp1, sp2, sp3这几个版本的补丁是否修复了此问题.
zjcxc 元老 2006-07-04
  • 打赏
  • 举报
回复
2005中没有问题.
昵称被占用了 2006-07-04
  • 打赏
  • 举报
回复
生成查询计划的问题,这个好像很严重,连接强行中断,临时表都不见了

昵称被占用了 2006-07-04
  • 打赏
  • 举报
回复
full join没问题
昵称被占用了 2006-07-04
  • 打赏
  • 举报
回复
select a.xid,b.xnum,a.xnum2 from #table21 a left outer join #table11 b
on a.xid=b.xid and (select count(*) from #table21 where xid=a.xid and id<a.id)=(select count(*) from #table11 where xid = b.xid and id<b.id)



select b.xid,a.xnum,b.xnum2 from #table11 a right outer join #table21 b
on a.xid=b.xid and (select count(*) from #table11 where xid=a.xid and id<a.id)=(select count(*) from #table21 where xid=b.xid and id<b.id)

本来应该是一样的语句,但是下一个出错
wangdehao 2006-07-04
  • 打赏
  • 举报
回复
是啊,我搜索了一下,以前就有用right join遇上过这个问题的,可是没有找到答案。
昵称被占用了 2006-07-04
  • 打赏
  • 举报
回复
好像是老问题
wangdehao 2006-07-04
  • 打赏
  • 举报
回复
打上sp4后,可以正常运行上面的right join了
昵称被占用了 2006-07-04
  • 打赏
  • 举报
回复
我的sp3

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧