title: How to validate data in sql server?
body: <p>I have an issue related to data in sql server. In my database some of the constraint were not enabled i.e. they were not checked , After some time working on it we found this issue that a parent rows can be deleted without deleting child, which was an issue. I enabled all the constraint in the database using query </p>
  
  <pre><code>ALTER TABLE tbl_name CHECK CONSTRAINT ALL 
  </code></pre>
  
  <p>above query was executed on all the tables of that database without any error . But my concern is whether it will work or not , if it will work on the existing data then what will happen to that data whose parent table data has been deleted. </p>
  
  <p>I want to know is there any way such that I can validate such data data whose parent record doesn't exist in the entire database. There are about <code>270 constraint</code> containing <code>FOREIGN KEY AND UNIQUE KEY</code> . I don't want to go for manual option.</p>
  
  <p>Please help me out.</p>