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 898053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:58:49+00:00 2026-05-15T14:58:49+00:00

In our inventory database (SQL Server 2008 std edition) we have a table (called

  • 0

In our inventory database (SQL Server 2008 std edition) we have a table (called Stock Results) that stores results for each stock item by stock period, that looks like this:

<< StockResults >>
PK StockPeriodID int
PK StockItemID int 
OStockCost money 
OStockQty real 
DeliveriesQty real 
CreditsQty real 
TransfersInQty real 
TransfersOutQty real 
CStockQty real 
OStockAmt money 
DeliveriesAmt money 
CreditsAmt money 
TransfersInAmt money 
TransfersOutAmt money 
CStockAmt money
... except that it has about 40 columns

We are considering normalising that table, so that we have a table for fields and another for data. Like this:

create table StockResults_Fields
(FieldID int, FieldName varchar(20), FieldDataType varchar(10))

create table StockResults_Values
(StockPeriodID int, StockItemID int, FieldID int, FieldName varchar(20), FieldDataType varchar(10))

The reason we are considering doing that is to improve the performance of the table and to prevent deadlocks (which we are currently getting). The advice on normalizing to reduce deadlocks comes from this article: Reducing SQL Server Deadlocks.

My concerns are that the results table (which is already large), will get even bigger. And most of the reports display data in a structure that is similiar to the current structure — the new way will have quite a few more joins.

Before we start on something that will involve quite a lot of work, does anyone have any advice on this normalized structure for results and the performance benefits before we start?

EDIT: Thanks for the advice. I had a gut feeling that the 2-table approach wasn’t the way to go, but I wasn’t sure why — until now. The locking error has been solved: we had a table with no clustered index, but the snapshot isolation looks like something we might consider.

  • 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-15T14:58:50+00:00Added an answer on May 15, 2026 at 2:58 pm

    It sounds like you know all the needed columns at the time of designing the system. If that’s the case, you should absolutely not proceed with the design you proposed.

    The only possible reason for that kind of design is if you don’t know all the fields you will need at design time, and need to add some after you are in production.

    I would predict that your two-table approach would perform much worse than your current approach.

    Also, this has nothing to do with normalization, at least by my definition. What you would be doing is moving away from a relational model and toward a metadata model.

    (Edit: you should also post more info about when/where the deadlocks are occurring, if that is the root of the problem you are trying to solve).

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

Sidebar

Related Questions

I have an existing SQL Server 2005 database that runs our accounting/inventory application. We
Our current database layout for store inventory includes a table that houses a record
I have a database which has an orders table and inventory table. The order-items
We have a 12-year-old Ms Access app that we use for our core inventory
I have a CSV file with information about our inventory that gets changed locally
We have a web application that manages inventory for our computer support group. One
Our application is a Java-GWT application that uses Guice-Persist and Guice-Servlet extensively. We have
We currently have an inventory management system that was built in-house. It works great,
I'm working with an Inventory Ledger stored as a report/view in our database. When
I have a program that we use to connect our Magento store to our

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.