Problem with @@rowcount/@@error on 4.01 
Author Message
 Problem with @@rowcount/@@error on 4.01


The following code illustrates the problem with any insert statement that
fails but should be picked up by the following conditional test and cause the
proc to exit.  Infact the Procedure doesn't exit it continues to attempt the
2nd insert (which will also fail).

Our Server is Ver 4.0.1 EBF 1160.

We would be interested to know if this problem is associated with our
particular Version/EBF Level.

Try it, You'll like it.

Jem......

                     --------------- oOo --------------------

drop table jem_temp
go

create table jem_temp(
        a           int   NOT NULL,
        b           int   NOT NULL,
        c           int   NOT NULL
)
go

/* Create a Stored Procedure */

drop proc jem
go

create proc jem
as

insert jem_temp values (1,2,NULL)        /* This will Fail                */


BEGIN
        print "Help"
        return  200         /* Should return 200      */
END

insert jem_temp values (4,4,NULL)        /* This Will Fail as well   */


BEGIN
        print "Help"
        return  20           /* Should Return 200      */
END

return 1                               /* Proc Should Return 1   */

go

                         --------------- oOo -------------------

---
Reply To
--------




Sun, 06 Aug 1995 17:02:03 GMT
 Problem with @@rowcount/@@error on 4.01



        insert jem_temp values(....

        BEGIN....

Or, if you must check rowcount *AND* error:


        BEGIN...

Cheers,
Howie



*>
*>The following code illustrates the problem with any insert statement that
*>fails but should be picked up by the following conditional test and cause the
*>proc to exit.  Infact the Procedure doesn't exit it continues to attempt the
*>2nd insert (which will also fail).
*>
*>Our Server is Ver 4.0.1 EBF 1160.
*>
*>We would be interested to know if this problem is associated with our
*>particular Version/EBF Level.
*>
*>Try it, You'll like it.
*>
*>
*>Jem......
*>
*>                     --------------- oOo --------------------
*>
*>
*>drop table jem_temp
*>go
*>
*>create table jem_temp(
*>   a           int   NOT NULL,
*>   b           int   NOT NULL,
*>   c           int   NOT NULL
*>)
*>go
*>
*>/* Create a Stored Procedure */
*>
*>drop proc jem
*>go
*>
*>create proc jem
*>as
*>
*>insert jem_temp values (1,2,NULL)        /* This will Fail                */
*>

*>BEGIN
*>   print "Help"
*>   return  200         /* Should return 200      */
*>END
*>
*>insert jem_temp values (4,4,NULL)        /* This Will Fail as well   */
*>

*>BEGIN
*>   print "Help"
*>   return  20           /* Should Return 200      */
*>END
*>
*>return 1                               /* Proc Should Return 1   */
*>
*>go
*>
*>                         --------------- oOo -------------------
*>
*>
*>---
*>Reply To
*>--------


---

#define OPINIONS "My own"   * Fannie Mae, Unix Technical Services   *
                            * 3900 Wisconsin Avenue NW              *
main(){for(;;);}            * Washington, DC, USA           20016   */



Tue, 08 Aug 1995 00:05:37 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. JDBC driver, MySQL, Explorer 4.01 problem

2. IE 4.01 on Mac problem

3. Paradox index problem with Delphi 3.02 /BDE 4.01

4. DAT Tape problem after move from 4.01 to 5.03

5. PDOX Dos 4.5, W3.11, Novell 4.01 Problems

6. Impromptu 4.01 and OpenIngres Net 2.0 problems

7. Installing SQL 7 on NT 4.01

8. SQL Enterprise Manager to crash when using IE 4.01

9. SQL Enterprise Manager to crash when using IE 4.01

10. Korean character garbaged in SQL 6.5 + IIS 4.0 + IE 4.01

11. SQLServer 7.0: IE 4.01 required on Server ?


 
Powered by phpBB® Forum Software