Delete unused Practice Areas

Delete unused Practice Areas

The following SQL script will delete unused practice areas.

  1. --Delete any practice areas that are not used
  2. UPDATE
  3. __M_Matters_PracticeAreas
  4. SET
  5. Final_Status = 'Deleted'
  6. WHERE 1=1
  7. AND Id NOT IN(
  8. SELECT
  9. Final_PracticeArea_Id
  10. FROM
  11. __M_Matters
  12. WHERE
  13. Final_Status != 'Deleted'
  14. )