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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Handling between two Servers

Status
Not open for further replies.

epalacios

Technical User
Jan 25, 2005
2
0
0
PE
Hi this is the cass:

SERVER A: Executes the following

INSERT INTO SERVERB.DB.owner.TABLE VALUES ('23232')

IF @@ERROR != 0
PRINT 'An Error !!!'


The sentence produces an error , but when I check the value of @@ERROR , this is equal to zero. I tried to use distributed transactions but it seems like there is a bug with distributed transactions cause I could not make that works here. I have two MS SQL Server 7.0 .

Any advise will be very appreciated.

Thanks,

Eduardo

epalacios@orientalfg.com
 
If you put this insert into a stored procedure on the other server, and return @@error to your calling server, then you will be able to see the error that is occurring on your linked (or remote) server.

You are not populating @@error in this case because it is occurring on the other server. The calling server has no way to access @@error from another server... make sense?

Tom Davis
tdavis@sark.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top