Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Your first paragraph answers the question. If performance is your only concern, validation has to be done in DB Commented Apr 4 at 22:29
  • Are you writing a control system for a passenger jet carrying 400 people, or Facebook for Cats? Commented Apr 5 at 21:47
  • It's not an answer to your title question but you can implement this validation as part of your insert/update by using a where clause which implements your condition. Then you check for how many rows were created or updated. It's a little tricker for the insert but still doable. Commented Apr 7 at 16:32