title: SQL Server Query -- How to continue on error
body: <p>I have a table containing thousands of fields and some of them were duplicated due to customer's failure and I need to fix it.
  I can find them and delete them row by row, but I am looking for a faster work around.</p>
  
  <p>As some of these are related to other tables, they can not be deleted directly without taking care of the relation. I wand to first delete those are not included in the relationship by running a simple DELETE command without any conditions, so all unrelated rows will be deleted and rest of them can be done rapidly.</p>
  
  <p>Here is the question, What can I do to skip errors and delete all unrelated rows?
  Currently when I run the query, it stops when the first related ID is found.(The conflict occurred in database ....)</p>
  
  <p>Any suggestions?</p>