hi, all.
On SQLserver7 EE&sp2 , on windowNT4.0EE&sp6
In a stored procedure, I have three result sets return. Right after the
first resultset, I have a check like if there is no rows affected in the
first result set, i raise an error. And, I suppose the following two result
will return, even they maybe empty.
My problem is, if the error raised and the second result set is empty, it
DOESNOT return.
In the following example, if I execute
exec t_sp 1
everything is ok, please note the second result is empty.
But, if I run
exec t_sp 4
this will return.
rowid rowname
----------- ----------
Server: Msg 50000, Level 16, State 1, Procedure t_sp, Line 10
Error
rowid rowname
----------- ----------
1 a
2 b
3 c
Where is the second empty result set ??? Bug?
Thanks in advance.
-- scripts
create table t_table (rowid int, rowname char(10))
insert into t_table values (1,'a')
insert into t_table values (2,'b')
insert into t_table values (3,'c')
go
create procedure t_sp
as
set nocount on
-- result set 1
begin
raiserror ('Error', 16, 1) with seterror
end
-- result set 2
select * from t_table where rowid = 0
-- result set 3
select * from t_table
go
--
-
Best Regards
/'"`\ zzzZ |
( - - ) |
--oooO--(_)--Oooo-----------------------------------------------------
Life Is A Journey, Enjoy The Ride.
**********************************************************************
**********************************************************************