|
Posted by Erland Sommarskog on 11/06/05 16:44
Mary Walker (123@123.com) writes:
> I still haven't got a decent book on relational databases :-)
>
> My stored procedure insert_wire inserts values into two tables (wire and
> cablewire). The wire_ref (primary key) will be the same for both inserts.
> However, if for any reason the first insert fails then I would like a
> rollback system to take place. I have tried testing for an error (@@error
><> 0) after the 1st transaction but I just get a syntax error. Am I going
> down the right lines here? Any tips appreciated.
Probably not. Judging from the syntax in your posts, you are using
some other DB engine than Microsoft SQL Server, which is the RDBMS
this group is about. @@error, on the other hand is a feature in
MS SQL Server, that I would expect not appear anywhere else, except
for Sybase.
So I think you should first out what product you are using, and then
a forum for that product.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|