none
How to create more than one unique column

    Question

  • Hi 

    I have a table having following fields

    Agent_Id ( primary key)

    Name

    FatherName

    National_Identity_No  // indeed this is the unique no assigned by the govt.

    Now the problem is i also want to keep National_Identity_No field unique. please guide me how to do it.

       

    Saturday, October 19, 2013 12:23 PM

Answers

  • Hello,

    You need to add a unique constraint to the column National_Identity_No. You can do that either through Tsql or ssms following the below BOL

    Create Unique Constraint

    Alter table TABLENAME add constraint CONSTRAINTNAME unique (National_Identity_No)

    GO


    Thanks

    Please click the Mark as answer button and vote as helpful if this reply solves your problem



    Saturday, October 19, 2013 1:00 PM