title: How to create Composite Key and how to refer it in other table as a foreign key
body: <p>I have a table following table</p>
  
  <pre><code>create table tblcountry (
    unqid uniqueidentifier 
    name varchar(100)
    isremoved bit
  )
  </code></pre>
  
  <p>I want to create primary key on basis of unqid + isremoved and in which isremoved must be true</p>
  
  <p>i have got another table:</p>
  
  <pre><code>create table tblstate (
    unqid uniqueidentifier,
    name varchar(100)
    f_tblcountry uniqueidentifier,
    isremoved bit
  )
  </code></pre>
  
  <p>the main thing is that i want that when i try to make isremoved field as true or 1 of tabcountry than it should give me error if i have useid it in referenced table tabstate and the record to which it used its isremoved field is not true. and if the tabstate the isremoved is true for that primary key than its should not give any error.</p>