SQL Server Performance

2 unique coloumn in table

Discussion in 'General Developer Questions' started by jumbo, Oct 3, 2005.

  1. jumbo New Member

    I want to define 2 unique coloumns in my table.Is this is possible with sql server
  2. Madhivanan Moderator

    Is this you wanted?

    Create table yourTable(u1 int unique, u2 int unique)


    Madhivanan

    Failing to plan is Planning to fail
  3. jumbo New Member

    yes exactly
  4. Madhivanan Moderator

    I wonder why you want this [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]<br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
  5. Adriaan New Member

    Yes, two unique keys are only "necessary" when you need your own unique key, and you are assuming that an external key is also unique.

    Never trust outside keys to be unique.

    And if the second key is also an internal unique key then I wish you good luck, because there must be some organizational mess-up.

Share This Page