Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 1st, 2004, 10:33 PM
rainbow11 rainbow11 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Canada
Posts: 133 rainbow11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 38 m 22 sec
Reputation Power: 5
using identity as a primary key

Hi everybody,

Where I should use identity as a primary key and where shouldn’t?

Any examples and suggestions.
Thanks in advance

rainbow11

Reply With Quote
  #2  
Old September 7th, 2004, 06:18 PM
Scorpions4ever Scorpions4ever is offline
Mad Rater
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 126 Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
My personal rules-of-thumb (and it is decided by the primary key for the table):
1. If the primary key is only one field (or you can't think of which field to use as primary key), create an identity field and use that as the primary key.
2. If the primary key is more than one field, then use those fields as the primary key.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.

Reply With Quote
  #3  
Old September 8th, 2004, 08:53 PM
rainbow11 rainbow11 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Canada
Posts: 133 rainbow11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 38 m 22 sec
Reputation Power: 5
thanks Scorpions4ever for your expert advice.
thanks again for reply
rainbow11

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > using identity as a primary key


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT