title: join multiple table to delete/update in sql server
body: <p>I want to delete user(update) I have also 8 deal table ,match table and futured table related to user table .
  I want if I delete( InActive)user then must be delete all activitry from other 8 table also I have written sp but I know this is not right way to do this ....I want to use join ( or other way ) how can I do this ...Please help me ..thanks</p>
  
  <pre><code>   CREATE PROC [dbo].[bb_DeleteUser]   
      @userId  int  
      AS   
      SET NOCOUNT ON   
      SET XACT_ABORT ON    
  
      BEGIN TRAN    
  
      UPDATE  bb_user SET IsActive =0 WHERE user_id = @userId 
  
      IF EXISTS (SELECT * FROM DealA WHERE [user_id]= @userId ) 
      BEGIN
          update DealA  
          set [acq_veripro]= 'Del',[acq_status] = 'Closed',[acq_isclose] = 0,[acq_modifieddate]= Getdate()  
          where [user_id]= @userId  
      END
  
      IF EXISTS (SELECT * FROM DealB WHERE [user_id]= @userId ) 
      BEGIN     
          update DealB  
          set [fundfundraise_veripro]= 'Del',[fundfundraise_status] = 'Closed',[fundfundraise_isclose]  = 0,[fundfundraise_modifieddate] = Getdate()  
          where [user_id]= @userId 
      END  
  
      IF EXISTS (SELECT * FROM DealC WHERE [user_id]= @userId ) 
      BEGIN          
          update DealC  
          set [provider_veripro]= 'Del',[provider_status] = 'Closed',[provider_isclose]  = 0,[provider_modifieddate] = Getdate()  
          where [user_id]= @userId 
      END               
  
      IF EXISTS (SELECT * FROM DealD WHERE [user_id]= @userId ) 
      BEGIN 
          update DealD  
          set [seek_veripro]= 'Del',[seek_status]  = 'Closed' ,[seek_isclose] = 0,[seek_modifieddate] = Getdate()  
          where [user_id]= @userId 
      END          
  
      IF EXISTS (SELECT * FROM DealE WHERE [user_id]= @userId ) 
      BEGIN 
          update DealE  
          set [lpinvestor_veripro]= 'Del',[lpinvestor_status] = 'Closed',[lpinvestor_isclose] = 0,[lpinvestor_modifieddate]= Getdate()  
          where [user_id]= @userId  
      END
  
      IF EXISTS (SELECT * FROM DealF WHERE [user_id]= @userId ) 
      BEGIN   
          update DealF  
          set [sellseek_veripro]= 'Del',[sellseek_status] = 'Closed',[sellseek_isclose] = 0,[sellseek_modifieddate] = Getdate()  
          where [user_id]= @userId         
      END
  
      IF EXISTS (SELECT * FROM Match WHERE Seeker_id =@userId or  Provider_id=@userId  ) 
      BEGIN
          update Match  
          set [IsActive]=0 ,[Match_ModifiedDate]=GETDATE()  
          where Seeker_id =@userId or  Provider_id=@userId    
      END
  
      IF EXISTS (SELECT * FROM Featured_Deal WHERE Deal_User_Id= @userId  ) 
      BEGIN
         UPDATE Featured_Deal
          set [Active_Status]= 0,[Modified_Date]= Getdate()  
          WHERE Deal_User_Id= @userId  
      END
  
  COMMIT
  </code></pre>