title: SQL Server : check if all rows exists in other table
body: <p>I need to know if all rows from one table exists in other:</p>
  
  <pre><code>declare @Table1 table (id int)
  declare @Table2 table (id int)
  
  insert into @Table1(id) values (1)
  insert into @Table1(id) values (4)
  insert into @Table1(id) values (5)
  
  
  insert into @Table2(id) values (1)
  insert into @Table2(id) values (2)
  insert into @Table2(id) values (3)
  
  if exists (select id from @Table1 where id in (select id from @Table2))
      select 'yes exists'
  else
      select 'no, doesn''t exist' 
  </code></pre>
  
  <p>This query returns <code>yes exists</code> but should return <code>no, doesn't exist</code> because only 1 exists in <code>@Table2</code>, values 4 and 5 don't. </p>
  
  <p>What should I change in my query? Thanks!</p>