Question: I have 2 tables. I need to check before insertion in one table if the value exist in other table.

Answer: 
I suggest that, you should first check the records that is going to be inserted in each request.

```
Create Proc Testing
as
Set NoCount ON
Set XACT_ABORT ON

Begin Try
   Begin Tran
    IF Not Exists(SELECT 1 FROM Table2 i JOIN Table1 t ON i.key = t.key)
    Begin
         //Your insert statement
    END
   Commit Tran
End Try

Begin Catch
    Rollback Tran
End Catch

```
IF NOT EXISTS ( SELECT \* FROM TableA WHERE Col1 = @Value)
INSERT INTO TableB(Col1) SELECT @Value