Help me with adding a constraint to a table.

  • Select MemberNbr, EligYear,EligMonth, count(*) FROM [MemberMonth]

    GROUP BY MemberNbr, EligYear,EligMonth HAVING COUNT(*) > 1

    THIS WILL GIVE ME ZERO ROWS,,, That is GOOD which means NO DUPLICATES....

    I need to add a constraint to the table

    MEMBERMONTH to make sure no one can insert duplicate

    records.

    Can you suggest what constraint to add ?

    The fields are

    MemberNbr VARCHAR,

    EligYear INT ,

    EligMonth INT

  • UNIQUE INDEX on the three columns

    (UNIQUE CONSTRAINT comes to the same thing, I think??, in SQL Server)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply