Unique Constraint

  • I have two columns Student_ID and MAC_ID in my table.

    I want to put Unique constraint on these two columns together.

    I am using SQL Server Management Studio 8 .

    Can you please tell me the steps ?

  • spectra (9/23/2013)


    I have two columns Student_ID and MAC_ID in my table.

    I want to put Unique constraint on these two columns together.

    I am using SQL Server Management Studio 8 .

    Can you please tell me the steps ?

    Alter table table_name

    ADD constraint constraint_name UNIQUE (Student_ID, MAC_ID)

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • kapil_kk (9/23/2013)


    spectra (9/23/2013)


    I have two columns Student_ID and MAC_ID in my table.

    I want to put Unique constraint on these two columns together.

    I am using SQL Server Management Studio 8 .

    Can you please tell me the steps ?

    Alter table table_name

    ADD constraint constraint_name UNIQUE (Student_ID, MAC_ID)

    thanks.

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

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