Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
briankind
Starting Member
17 Posts |
Posted - 2009-07-25 : 02:12:43
|
what is a Primary Key vs Composite Key when do i use them? |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-07-25 : 02:15:31
|
In Primary key single field (i.e column) acts as keyIn Composite Primary key more the one column acts as Primary Key..You want more details go through Books or just google it..Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
|
dportas
Yak Posting Veteran
53 Posts |
Posted - 2009-07-25 : 05:23:58
|
A composite key is any candidate key with more than one attribute.A primary key is any one of the candidate keys (composite or not) of a relation (or relation variable or "table").For relations with more than one key the idea of designating a "primary" key at all is arguably a fairly arbitrary and flexible concept. It just means that one key is chosen to be of special significance for some possibly unspecified reason. However, the primary key is often seen as very important in SQL database design because it is usually assumed that the primary key will be the one referenced by foreign keys in other tables and that therefore the management of those primary keys is a special consideration during design. |
|
|
|
|
|