I'm running a query with transation isolation level 0,
zero timeout. My SQL is:
set transaction isolation level read uncommitted
set lock_timeout 0
select
coid=convert(int, B.LOC),
atype = 'yb',
name = convert(varchar(20), rtrim(A.NAME)),
from (multi-table join)
Most of the time I get the correct result. First few
lines are:
!coid !atype!name !alt_name
!id !zzz_id !billable !descr
!p1
!p2
!p3!p4!p5!feature1 !feature2 !feature3
!feature4 !feature5 !feature6 !feature7
!feature8 !feature9 !extra
!-----------!-----!--------------------!--------------------!-----------!---------------!-----------!------------------------------------------------------------!------------------------------------------------------------!------------------------------------------------------------!--!--!--!-----------!-----------!-----------!-----------!-----------!-----------!-----------!-----------!-----------!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
! 55016!zz !ZZZZZZ01 !ZZZZZZ01
! 7259!1pwrqwe ! 1!NULL
!qqqqq11
!zzzzzz01
! ! ! ! 1! 0!
0! 0! 0! 0! 0!
0! 0!NULL
... Many more lines
(1563 rows affected)
When the problem occur I get an extra two lines at the
beginning of the output (second line is empty)
(return status = 0)
My best guess is that I get extra result set from the
query. This problem occurs infrequenty (usually when
running the job first time in the morning).
I suspect that this is somehow related to the isolation
mode - maybe sqsh/freetds incorrectly parsed a messages
regarding bypassing a lock, or reading uncommit data.
I never got the message when I ran at isolation level
1 - but sometimes I experienced delay due to locking
problem.