Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:21:57+00:00 2026-05-16T11:21:57+00:00

I have a SalesOrder table and a separate Address table. The SalesOrder has two

  • 0

I have a SalesOrder table and a separate Address table. The SalesOrder has two addresses – thus avoiding use of a list, there are the Delivery and Invoice address. This is how they have been mapped in the SalesOrder mapping file:

<many-to-one name="DeliveryAddress" class="Address" column="`DeliveryAddressGUID`" />
<many-to-one name="InvoiceAddress" class="Address" column="`InvoiceAddressGUID`" />

Is it actually possible to have this relationship – where two separate fields in the same table reference another. If I remove one of the “many-to-one” associations, I can add Address to the table, otherwise if I keep both associations I get the following exception:

"The UPDATE statement conflicted with the FOREIGN KEY constraint \"FK67C9F3E2FBD32E03\". The conflict occurred in database \"Dispatch\", table \"dbo.Address\", column 'GUID'.\r\nThe statement has been terminated."

Am I doing something wrong?

Thanks

Edit
These are the relevant parts of the two tables:

SalesOrder
------------
Guid
DeiveryAddressGuid
InvoiceAddressGuid
...

Address
------------
Guid
HouseNameOrNumber
AddressLine1
AddressLine2
...

The error is really strange since it won’t let me simply add an address to the Address table by itself with both Foreign Keys active (this is in NHibernate, I’ve not been able to test this directly with SQL Server).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:21:58+00:00Added an answer on May 16, 2026 at 11:21 am

    did you check to make sure both of those entries where in the parent table?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have a Table named Sales with a SalesOrderId. Then you have two
I have two temp tables, both populated by TSQL queries. Temp Table A containing
I have a SalesOrderItem table, and it has a UnitPrice column in case the
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I have a Sales table, with the following columns: employeeID amount date Now I
I have a table which contains sales order data (order number, product number, sales
I have two repository classes below, MoneyTransferRepository class is used by other classes in
I have a SalesOrder class which is inherited by several different types of sales
I know there is a way to programmatically invoice, ship, and set state on
I have a script that appends some rows to a table. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.