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 Core
  • .NET MAUI
  • .NET Standard
  • Active Directory
  • ADO.NET
  • Agile Development
  • AI
  • AJAX
  • AlbertAGPT
  • Alchemy
  • Alexa Skills
  • Algorand
  • Algorithms in C#
  • Android
  • Angular
  • Apple
  • Arbitrum
  • ArcObject
  • ASP.NET
  • ASP.NET Core
  • Augmented Reality
  • Avalanche
  • AWS
  • Azure
  • Backbonejs
  • Base Blockchain
  • Big Data
  • BizTalk Server
  • Blazor
  • Blockchain
  • Bootstrap
  • Bot Framework
  • Business
  • Business Intelligence(BI)
  • C#
  • C# Corner
  • C# Strings
  • C, C++, MFC
  • Career Advice
  • Careers and Jobs
  • Chapters
  • ChatGPT
  • Cloud
  • Coding Best Practices
  • Cognitive Services
  • COM Interop
  • Compact Framework
  • Copilot
  • Cortana Development
  • Cosmos DB
  • Cryptocurrency
  • Cryptography
  • Crystal Reports
  • CSS
  • Current Affairs
  • Custom Controls
  • Cyber Security
  • Data Mining
  • Data Science
  • Databases & DBA
  • Databricks
  • Design Patterns & Practices
  • DevExpress
  • DevOps
  • DirectX
  • Docker
  • Dynamics CRM
  • Enterprise Development
  • Entity Framework
  • Error Zone
  • Exception Handling
  • F#
  • Files, Directory, IO
  • Flutter
  • Games Programming
  • GDI+
  • General
  • Generative AI
  • GO
  • Google Cloud
  • Google Development
  • Graphics Design
  • Graphite Studio
  • Hardware
  • Hiring and Recruitment
  • HoloLens
  • How do I
  • HTML 5
  • Infragistics
  • Internet & Web
  • Internet of Things
  • Ionic
  • Java
  • Java and .NET
  • JavaScript
  • JQuery
  • JSON
  • JSP
  • Knockout
  • Kotlin
  • Langchain
  • Leadership
  • Learn .NET
  • Learn iOS Programming
  • LINQ
  • Machine Learning
  • Metaverse
  • Microsoft 365
  • Microsoft Fabric
  • Microsoft Office
  • Microsoft Phone
  • Microsoft Teams
  • Mobile Development
  • MongoDB
  • MuleSoft
  • MySQL
  • NEAR
  • NetBeans
  • Networking
  • NFT
  • NoCode LowCode
  • Node.js
  • Office Development
  • OOP/OOD
  • Open Source
  • Operating Systems
  • Oracle
  • Outsourcing
  • Philosophy
  • PHP
  • Polygon
  • PostgreSQL
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pages
  • Printing in C#
  • Products
  • Progress
  • Progressive Web Apps
  • Project Management
  • Public Speaking
  • Python
  • Q#
  • QlikView
  • Quantum Computing
  • R
  • React
  • React Native
  • Reports using C#
  • RevealBi
  • Robotics & Hardware
  • RPA
  • Ruby on Rails
  • RUST
  • Salesforce
  • Security
  • Servers
  • ServiceNow
  • SharePoint
  • Sharp Economy
  • SignalR
  • Smart Devices
  • Snowflake
  • Software Architecture/Engineering
  • Software Testing
  • Solana
  • Solidity
  • Sports
  • SQL
  • SQL Server
  • Startups
  • Stratis Blockchain
  • Swift
  • SyncFusion
  • Threading
  • Tools
  • TypeScript
  • Unity
  • UWP
  • Vibe Coding
  • Visual Basic .NET
  • Visual Studio
  • Vue.js
  • WCF
  • Wearables
  • Web API
  • Web Design
  • Web Development
  • Web3
  • Windows
  • Windows Controls
  • Windows Forms
  • Windows PowerShell
  • Windows Services
  • Workflow Foundation
  • WPF
  • Xamarin
  • XAML
  • XML
  • XNA
  • XSharp
  • Register
  • Login
4
Answers

SalesOrderDetail table AdventureWorks2008R2 Primary Keys

Photo of Rodney Johnson

Rodney Johnson

12y
2.5k
1
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


Answers (4)

Next Recommended Forum
Manish Sharma
Index Configurations of Table
Shape in SQL Server Vipendra Verma
Forum Statistics
  • Please welcome our newest member Vidyu Latha.

  • 3,089,169 users have contributed to 147,412 threads and 483,540

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

  • In last week, the most popular thread is 'what is Pandas how to use?'.

Upcoming Events
View all
  • Live Discussion on Startups and Career Growth
  • From Prompt to Product: Coding in the Age of Gen AI
  • Auto-Archive Client Documents for Compliance: Automate Your Business Processes - Ep.6
Submit your idea and earn rewards
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.