Our DTS packages pull data from multiple tables form Oracle. The problem we have is that the connection sometimes will drop. I want to write a checking method, first to query the connnection, if there, then pull the data. If not, try, say three times. I write the following script, run on my test pc, create a linkserver, then unplug my network cable. Theoretically, if the connection fails, I should at least have three printed message, yet it is not. I think @@ERROR may not return the connection error or is there a bug in the script? DECLARE @err int, @rowcntint, @icountint SET @icount = 0 CONN_LOOP: IF @icount < 3 BEGIN SELECT * into UserLists from LinkServer.DatabaseName.dbo.UserLists SELECT @rowcnt=@@rowcount, @err = @@ERROR PRINT ( 'loop: ' + cast(@ICOUNT as varchar(5))) SET @icount = @icount + 1 IF (@@ERROR <>0 and @rowcnt <= 0 ) GOTO CONN_LOOP END ELSE BEGIN GOTO END_Conn END GOTO END_Conn END_Conn: thanks all in advance.