title: SQL Server : usage of In vs Exists
body: <p>I have some doubts on when to use IN operator and Exists operator. I know what they both are. </p>
  
  <p>Say, I have this query: </p>
  
  <pre><code>Insert into AuditCardTypeBenefit_New(AuditID, AuditType, CardTypeBenefitID, EventCode,
                                       CardTypeGroupID, AgeFrom, AgeTo, Gender,
                                       CreateBy, CreateDate,  Status,
                                       CancelReason, LastChangeBy, LastChangeDate) 
       select                 
           AuditID, AuditType, CardTypeBenefitID, EventCode,
           CardTypeGroupID, AgeFrom, AgeTo, Gender,
           CreateBy, CreateDate, Status,
           CancelReason, LastChangeBy, LastChangeDate
       from 
           AuditCardTypeBenefit
       where 
           exists (select * from PromotionEvent_New 
                   where PromotionEvent_New.EventCode = AuditCardTypeBenefit.EventCode)
  </code></pre>
  
  <p>I am inserting records to a table where the records must also exist in <code>promotionevent_new (eventcode)</code> to exist in this table I am inserting. This query works fine. I was wondering would it be better to use an alternative such as:</p>
  
  <pre><code>where EventCode in (select EVENTCODE from PromotionEvent)
  </code></pre>
  
  <p>Both queries return the same result - but which would be better for my case?</p>