If every value of the field should be unique then perhaps make it a key...Then you could just attempt to insert it and trap the key collision error when it is non-unique.
You could just query for it before running the insert but that will definately increase load on the db... sometimes this matters a lot more than others... if you have a big fancy dedicated database server that spends all day at 3% load then its not such a big deal...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.