SqlDbx Forum

SqlDbx

You are not logged in.

#1 2015-05-25 10:40:37

ptoniolo
Member

Behavior of Sqldbx when an error occurs

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

#2 2015-05-26 18:49:30

sqldbxhelp
Administrator

Re: Behavior of Sqldbx when an error occurs

This is a bug.
Thank you for finding an reporting it.
It will be fixed in a next release.

Offline

#3 2015-07-13 10:27:58

ptoniolo
Member

Re: Behavior of Sqldbx when an error occurs

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

#4 2015-07-13 19:02:58

sqldbxhelp
Administrator

Re: Behavior of Sqldbx when an error occurs

Yes it was, but unfortunately wrong file got released.
Download will be updated in the next few days.

Offline

#5 2015-07-14 04:57:08

ptoniolo
Member

Re: Behavior of Sqldbx when an error occurs

In the meantime do you suggest to revert to the previous 4.8 version?

Offline

Board footer

Powered by FluxBB