Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling

Status
Not open for further replies.

tapks

IS-IT--Management
Sep 6, 2001
72
IN
Hi!

I am facing the following problem while trapping the errors.

I have a table Test (id int, no int, name varchar(20)) where id & no are the primery keyes. I want to update this table depending on the matching of id & no. I have written the following code to update the same:

update test
set name = 'James'
where id=5 and no=30

print @@error

Even if the record is not available in the given condition it is still showing the value of @@error as 0.

Pl help me in resolving the same.

Thanks in advance.

bye.
 
what programming language is that? I know how to do it in VBA, but I don't recognize this...
 
I have written a stored procedure for it in MS SQL SERVER 7.0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top