473,978 Members | 43,242 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Primary and linking keys on SQL server tables

I've been designing SQL server databases for a while and have always
assumed that primary keys and linking keys should be numbers rather
than textual fields to improve performance. As an example, if i were
to create a new table i would put in a surrogate primary key that
autoincrements.

I've recently been challenged on this and cannot seem to find any
evidence that would support the view that this is best practice.

Anybody have opinions, or know of articles that provide any evidence
either way?
Jul 20 '05 #1
1 2040

"chris p reynolds" <ch************ @hotmail.com> wrote in message
news:78******** *************** ***@posting.goo gle.com...
I've been designing SQL server databases for a while and have always
assumed that primary keys and linking keys should be numbers rather
than textual fields to improve performance. As an example, if i were
to create a new table i would put in a surrogate primary key that
autoincrements.

I've recently been challenged on this and cannot seem to find any
evidence that would support the view that this is best practice.

Anybody have opinions, or know of articles that provide any evidence
either way?


http://www.winnetmag.com/Articles/Pr...ArticleID=5113

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
469
by: chris p reynolds | last post by:
I've been designing SQL server databases for a while and have always assumed that primary keys and linking keys should be numbers rather than textual fields to improve performance. As an example, if i were to create a new table i would put in a surrogate primary key that autoincrements. I've recently been challenged on this and cannot seem to find any evidence that would support the view that this is best practice. Anybody have...
7
2969
by: Ilan Sebba | last post by:
I am trying to add a record using SQL. My problem is that the primary keys are foreign keys, and these foreign keys are autonumbers. I therefore do not know the primary keys of the record I am trying to insert. I therefore do not think that I can use the sql "Insert Into" command. Here is a simplified illustration of my tables: tblFather NaturalKey1 NatuarlKey2
1
6392
by: Oren | last post by:
Hi, I've encountered difficulties in maintaining the primary key of a SQL Server view linked dynamically in VBA to an Access database. If I use the transferDatabase function, then the user is prompted to choose the unique identifyer. If I create the link via the ADOX catalog, then the key is lost and the data isn't updatable. The goal is to create a dynamically linked updatable view without prompting the user. Any suggestions?
18
12690
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many relations with the table containing no primary key. Do I just create two primary keys on the table that does not contain any primary key for this to become a composite primary key? Thank you in advance! Still a newbie,
115
6345
by: LurfysMa | last post by:
Most of the reference books recommend autonum primary keys, but the Access help says that any unique keys will work. What are the tradeoffs? I have several tables that have unique fields. Can I use them as primary keys or should I define an autonum primary key? One table has information about the 50 states in the US. The table looks like this:
1
2974
by: bhobbs | last post by:
We have a PostgreSQL database that contains several linking tables (all they contain is two foreign keys to link 2 other tables together). Is it necessary and/or advisable to specify the two attributes in these tables as a joint primary key? There is some disagreement among our team members and I'd like to get some more opinions. Thanks, Brandy
1
1710
by: lochmant | last post by:
I have a series of about 10 test databases with about 34 linked table each. I need to create an Access 2003 database front end for each of these. I am currently trying to write a script that will allow me to link Access 2003 tables to Oracle tables. The problem is that the Oracle table that I am linking to does not have primary keys. This is a problem because when I write the VBA to link the tables, the linkes tables do not end up with...
2
9176
by: Danny | last post by:
Hello, We imported a bunch of tables from a database and realized that the primary keys weren't copied to the destination db. In order to re- create the keys, we need to know which tables have them. Is there a command that I can use (on the source db) to find out which tables contain primary keys? The db has hundreds of tables and I'd rather not go through each one to see which has a primary key. Also, for future reference, is there a...
4
2031
by: Yesurbius | last post by:
Access 2003 - latest patches. Windows XP Problem: Table 1 is linked to Table2 by two fields. A Query is made to include all records from Table1 and only those from Table2 where the values match. When entering data into one of the Table2 fields that does not have a related record to Table1, the Table1.EmployeeID is being changed to zero (as opposed to propagating the Table1 keys into Table2 for the current record) If I go into Table1...
0
11837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11439
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10094
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8467
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6574
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5164
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.