List:General Discussion« Previous MessageNext Message »
From:js  Date:March 3 2007 10:03am
Subject:Re: Database table with unique no duplications
View as plain text  
Why do you recommend using trigger instead of unique index?
I think when unique index works I don't have any reason to use trigger.

If the field you want to be unique is big one, like char(1000) or TEXT,
You have to use trigger to save the uniqueness, though.

On 3/2/07, Anoop kumar V <anoopkumarv@stripped> wrote:
> I would suggest you put an after insert trigger which does the validation
> for you. If 2 fields are already null then it will just return an error and
> rollback else it will allow the insert to be committed.
>
> regards,
> Anoop
>
> On 3/1/07, Kory Wheatley <wheakorypersonal@stripped> wrote:
> >
> > I have a database called accountcreation, and I want to setup a table
> > called accountinfo.  This table will require that two out of the three
> > fields need to be "UNIQUE", I don't want duplications in these fields.  One
> > field is a integer value the other field is a character value.  What is the
> > best way to set this table up?
> >
> >
>
Thread
Database table with unique no duplicationsKory Wheatley2 Mar
  • Re: Database table with unique no duplicationsAlexander Lind2 Mar
  • Re: Database table with unique no duplicationsAnoop kumar V2 Mar
    • Re: Database table with unique no duplicationsjs 3 Mar
      • Re: Database table with unique no duplicationsAnoop kumar V3 Mar