title: SQL Exception error #547 & Foreign Key constraint violations while attempting a delete
body: <p>I'm looking at some code (I didn't write it!) to test that our code catches two error conditions upon attempting to delete a table row where dependencies exist.</p>
  
  <p>The code originally looked for specific text in the message rather than using the error number.</p>
  
  <p>In order to provide multi language support it would be better to catch the exception based on the error number rather than the error message.</p>
  
  <p>In the test there are two sets of text the code is looking for and I can't seem to ascertain what the difference is, so am uncomfortable just checking for error number 547.</p>
  
  <ol>
  <li>The DELETE statement conflicted with the REFERENCE constraint...</li>
  <li>The DELETE statement conflicted with the SAME TABLE REFERENCE constraint...</li>
  </ol>
  
  <p>Is it safe to assume that both error messages will have an error number of 547?
  Cheers
  Colin</p>