Design Suggestions for a Quotes Database

  • Hello All,

    I have a quote management database that needs to receive new quotes from an ASP.NET website running on the same server. I'm using SQL Server 2005 and need some guidance relative to ensuring relational integrity and cascading inserts into multiple tables.

    My tables are Customers, Orders, Quotes and QuoteDetail. Each customer can have numerous quotes and orders. Each quote is comprised of multiple parts and quantities (eg PartNumber1, Qty1, PartNumber2, Qty2) from Quote Detail. When the quote is approved the quote detail needs to be moved to order detail as well as quote going to orders table.

    I have primary keys setup for CustomerID, OrderID, QuoteID, and ID (QuoteDetail). Identity is also set to 1 for each of these. Foreign keys are in Customers table for QuoteID and OrderID, in Orders for CustomerID, QuoteDetailID, in Quotes for Customer ID, OrderID and ID for QuoteDetail.

    I have a stored procedure that is being called from a SQLDataSource attached to the Complete Wizard Step in my web application. The parameters have all been defined but I need to know whether I should reference my PKs and FKs in the stored procedure?

    Thanks so much for your help and guidance.

    Sid

  • Sid Childers (5/8/2010)... I need to know whether I should reference my PKs and FKs in the stored procedure?

    What do you mean with "reference my PKs and FKs in the stored procedure"?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Hi Paul,

    I was able to get this one figured out last night. Thanks for your reply.

  • Sid Childers (5/9/2010)


    I was able to get this one figured out last night. Thanks for your reply.

    I'm glad but... still curious 🙂

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply