Primary Key

Results 1 to 2 of 2

Thread: Primary Key

  1. #1
    Join Date
    Dec 1969

    Default Primary Key

    I am using SQL Server 2000 and I have question about the Primary Key. From the reading I have done, it seems customary to make the Primary Key a number field, ie., Customer ID. However, are there performance drawbacks to using a text/char data field, ie, username as the primary key? Further, does using a username as a primary key effect relational tables that also use the username as the primary key?<BR><BR>Thanks for your advise.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Primary Key

    Primary Key is an indexed field which can be used to "join" onto other tables. <BR>1) It MUST be unique<BR>2) It MUST NOT be null<BR>Therefore it makes a certain amount of sense to make it Numeric and autoinvrement (you can forget about it the two rules) <BR>If you make it a text field you are going to have to do those checks yourself....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts