Hi All,

I want to catch the next MSSQL error in my SQL code with following continue calculations

Server: Msg 17, Level 16, State 1, Line 1
SQL Server does not exist or access denied.

If REMOTE_SERVER_1 is inaccessible (as in (a) below) the executing of SQL will not continue with (b) - I need the code in (b) to run despite whether the previous exec was successful or not - Any ideas?

begin transaction
(a) exec REMOTE_SERVER_1...bankinsert '1' , '1' , 1 , 0 , 0
(b) print @@error
commit transaction

where REMOTE_SERVER_1 is link to server created by

EXEC sp_addlinkedserver @server = 'REMOTE_SERVER_1', @srvproduct = '',
@provider = 'SQLOLEDB', @datasrc = 'MYCOMP1', @catalog = 'mirror2'
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'REMOTE_SERVER_1', .....

Exec sp_serveroption 'REMOTE_SERVER_1', 'data access', 'true'
Exec sp_serveroption 'REMOTE_SERVER_1', 'rpc', 'true'
Exec sp_serveroption 'REMOTE_SERVER_1', 'rpc out', 'true'
Exec sp_serveroption 'REMOTE_SERVER_1', 'collation compatible', 'true'

Any help will be greatly appreciated