SQL Server Performance

composite primary key necessary

Discussion in 'SQL Server 2008 General Developer Questions' started by raviatvns, Mar 1, 2011.

  1. raviatvns New Member

    hi,I want to create a alpha numeric primary key like in a table there is a company name,agency name and no. like company name is CM , agency name is AN and no. is 001 so i want to create primary key like this CMAN001. So, do i use composite keys or is there a best way to do so. please help me out.thnx in advance
  2. FrankKalis Moderator

    Welcome to the forum!
    I would go for a composite key over three columns if I had to. But I might also consider adding a surrogate identity primary key and put a unique constraint on these three columns, depending on whether this table is referenced by others or not. This depends on so many other factors that only you know, that it is difficult to give any sensible advise.
  3. mmarovic Active Member

Share This Page