SqlDbx
You are not logged in.
I am testing various alternatives in the handling of errors in sql 2k8r2. I mean, different scenarios with begin try/catch, set xact_abort on and so on.
During my tests I realized that the sql code executed within the sqldbx interfaces do not have the same behavior as the same code executed in osql or in the ssms query analyzer.
This is an example of the code that behaves differently in sqldbx:
create procedure errtest_p0
as
select 'errtest_p0 pre'
raiserror('error',16,0)
select 'errtest_p0 post'
go
create procedure errtest_p1
as
set nocount on
select 'errtest_p1 pre'
exec errtest_p0
select 'errtest_p1 post'
go
When I execute errtest_p1 in osql or in the query analyzer, the rows returned are both the "pre" and the "post"'s, with the error message in-between. Something like:
errtest_p1 pre
errtest_p0 pre
Msg 50000, Level 16, State 1, Server ., Procedure errtest_p0, Line 4
error
errtest_p0 post
errtest_p1 post
Without a try/catch this is (unfortunately) what is expected. I am not concerned in the opportunity of this behavior... my point is that sqldbx returns the two "pre" lines, and stops on the error. This is not the same behavior as the "real" executing environment in sqlserver, and so this anomalous behavior was leading me astray...
Why does sqldbx behave in such a different way? I could not find any option in the settings to restore a "normal" (although stupid) behavior. This is really dangerous to a sql developer, because I was convinced that the code I wrote on sqldbx would run in the same way in the wild! Is there a way to have the original behavior for the treatment of the error conditions?
Thanks
Pietro
Offline
This is a bug.
Thank you for finding an reporting it.
It will be fixed in a next release.
Offline
If the new 4.9 version was supposed to fix this problem (the description says "3. Errors not handled correctly inside batch (SQL Server, Sybase ASE)"), the behavior of the app is still different from osql: I still get only the two "pre" messages and a strange "Function sequence error (MsgState=0)" in the Messages tab. I am using the 64 bit version on a sql2k8r2 database.
Moreover, when I execute the above code in the personal/free version (32 bit) of sqldbx, the messagebox "You can have only two Result Tabs in Personal Edition" opens twice!
Offline
Yes it was, but unfortunately wrong file got released.
Download will be updated in the next few days.
Offline
In the meantime do you suggest to revert to the previous 4.8 version?
Offline