1

In a procedure I control errors with TRY CATCH, but in an insert into linked server not runs for handling this errors, because try catch not run.

How I can handling this errors?

Example:

insert into linkedserver.database.dbo.table values ('value1','value2')

If the server isoffline I have error of connection of the SQLCLI and cannot control this error for insert in local when the linked server are offline for after when the server return to online status put the data in the remote server with another procedure.

Thanks

Jorge

2
  • 1
    You talk about "when the server return to online status" - why not build a solution that always assumes that the server is unavailable right now, and applies the change when the server is available. Something like Service Broker would handle this, and you'd no longer have any dependency on the remote server. Commented Sep 27, 2012 at 10:43
  • Please be aware that tags stand alone. That is, selecting the tags linked and server doesn't mean you're talking about the linked server feature in SQL Server. Commented Sep 27, 2012 at 16:51

1 Answer 1

1

if you wrap your code into a EXEC statment you will have access to the error.

like exec( 'insert into....')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.