HELP NEEDED !! Check for errors !

  • Hi all ,

    i need to insert data to a linked server . But if linked server is down or i get any errors ( syntax,connection etc) i have to insert that data to my local DB.

    eg.

    INSERT INTO [LinkedSrv].DB.dbo.Table (ID) values (1)

    but if the insert will not be succsessful

    i have to insert the same one in my machine

    insert into bllalblla values bllalbla

    how can i perform checks if the linked server insert is gonna be succesful ?

    thanks in advance .

  • Create a new linked server to test. Shut that server down.

    Run the insert and log the error you get.

    use try catch to control the error, then run the 2nd insert when you have the correct error.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply