473,836 Members | 2,140 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 2028

"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
2960
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
6385
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
12670
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
6289
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
2968
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
1705
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
9168
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
2021
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
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9656
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10821
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...
1
10571
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10241
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
9358
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...
0
5812
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4441
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
3
3102
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.