C# Corner
  • Tech
  • News
  • Videos
  • Forums
  • Jobs
  • Books
  • Events
    • Interviews
    • Live
    • Learn
    • Training
    • Career
    • Members
    • Blogs
    • Challenges
    • Certification
  • Article
  • Blog
  • Video
  • Ebook
  • Interview Question
  • .NET
  • .NET Assemblies
  • .NET Core
  • .NET Standard
  • Active Directory
  • ADO.NET
  • Agile Development
  • AJAX
  • Alexa Skills
  • Algorithms in C#
  • Android
  • Angular
  • Architecture
  • ArcObject
  • Artificial Intelligence
  • ASP.NET
  • ASP.NET Core
  • Augmented Reality
  • Aurelia
  • AWS
  • Azure
  • Backbonejs
  • Big Data
  • BizTalk Server
  • Blockchain
  • Bootstrap
  • Bot Framework
  • Business
  • C#
  • C# Corner
  • C, C++, MFC
  • Career Advice
  • Chapters
  • CIO
  • Cloud
  • COBOL.NET
  • Coding Best Practices
  • Cognitive Services
  • COM Interop
  • Compact Framework
  • Cortana Development
  • Cryptocurrency
  • Cryptography
  • Crystal Reports
  • Current Affairs
  • Custom Controls
  • Cyber Security
  • Data Mining
  • Databases & DBA
  • Design Patterns & Practices
  • DevOps
  • DirectX
  • Dynamics CRM
  • Enterprise Development
  • Entity Framework
  • Error Zone
  • Exception Handling
  • Expression Studio
  • F#
  • Files, Directory, IO
  • Games Programming
  • GDI+
  • General
  • Generative Engine Optimization (GEO)
  • Google Cloud
  • Google Development
  • Graphics Design
  • Hardware
  • Hiring and Recruitment
  • HoloLens
  • How do I
  • HTML 5
  • Internet & Web
  • Internet of Things
  • Ionic
  • iOS
  • Java
  • Java and .NET
  • JavaScript
  • JQuery
  • JSON
  • JSP
  • Knockout
  • kotlin
  • Leadership
  • Learn .NET
  • LightSwitch
  • LINQ
  • Machine Learning
  • Microsoft 365
  • Microsoft Office
  • Microsoft Phone
  • Mobile Development
  • Multithreading
  • Nano Banana
  • NetBeans
  • Networking
  • Node.js
  • Office Development
  • OOP/OOD
  • Open Source
  • Operating Systems
  • Oracle
  • Outsourcing
  • Philosophy
  • PHP
  • Power BI
  • Printing in C#
  • Products
  • Progressive Web Apps
  • Project Management
  • Python
  • Q#
  • QlikView
  • R
  • React
  • Reports using C#
  • Robotics & Hardware
  • Ruby on Rails
  • Salesforce
  • Security
  • Servers
  • SharePoint
  • SignalR
  • Silverlight
  • Smart Devices
  • Software Testing
  • SQL Language
  • SQL Server
  • Startups
  • String in C#
  • Swift
  • TypeScript
  • Unity
  • UWP
  • Visual Basic .NET
  • Visual Studio
  • WCF
  • Wearables
  • Web Development
  • Web Services
  • Web3
  • Windows 10
  • Windows Controls
  • Windows Forms
  • Windows PowerShell
  • Windows Services
  • Workflow Foundation
  • WPF
  • Xamarin
  • XAML Standard
  • XML
  • XNA
  • XSharp
  • Register
  • Login
4
Answers

SalesOrderDetail table AdventureWorks2008R2 Primary Keys

Photo of Rodney Johnson

Rodney Johnson

13y
2.1k
0
1 COM Interop
Hello,

I am working through the Beginning Microsoft® SQL Server® 2008 Programming text.  I have an understanding a table can have only one primary key.  However, it appear the SalesOrderDetail table has two: the SalesOrderID and the SalesOrderDetailID.  Below is a screen shot of the table columns.
I recognize the SalesOrderID is a is a foreign key to the SalesOrderHeader table.  However, it appears, by the coloring of the key and the PK in (PK, FK, int, not null) , that it is also a primary key for this table.  Can someone help me understand this?  Is it that the PK in the column definition refers to the fact it is a primary key in another table?  If so, why is it gold colored in this table?

Thanks


Insert Link

×

Embed YouTube Video

×

Table Options

×

Insert Image

×
Selected file:

Select an image from your device to upload

Answers (4)

Related Discussion
Forum Statistics
  • Please welcome our newest member .

  • users have contributed to threads and

  • In the past 24 hours, we have  new threads,  new posts, and  new users.

  • In last week, the most popular thread is .

Upcoming Events
View all
  • Agentic AI Virtual Event – Explore, Build, Deploy Your AI Agent in Action
  • Agentic AI Virtual Event – Explore, Build, Deploy Your AI Agent in Action
  • Get Together to Stay Connected

Our Training Programs

View all
  • AI & Machine Learning

  • Mastering Large Language Models

  • Mastering Prompt Engineering

  • Certified Vibe Coder

  • Github Copilot Training

  • Generative AI for Beginners

  • n8n Automation & AI Agents Training

Live
Agentic AI Virtual Event – Explore, Build, Deploy Your AI Agent in Action

Agentic AI Virtual Event – Explore, Build, Deploy Your AI Agent in Action

Message
About Us Contact Us Privacy Policy Terms Media Kit Partners C# Tutorials Consultants Ideas Report A Bug FAQs Certifications Sitemap Stories CSharp TV DB Talks Let's React Web3 Universe Interviews.help Jumpstart Blockchain Build with JavaScript

©2025 C# Corner.

All contents are copyright of their authors.