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
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.
That is baad idea IMO, better follow the steps described by Frank. The reasons you can find on my blog http://mirko-marovic-eng.blogspot.com/2011/01/natural-vs-surrogate-keys-that-is.html.