SQL Server Performance

SQL Server 2008 - Database Design Query

Discussion in 'SQL Server 2008 General DBA Questions' started by Diamond2016, Mar 20, 2012.

  1. Diamond2016 New Member

    I have to load the data shown in the below image into my database. Database.png
    For a particular row, either field PartID would be NULL OR field GroupID will be NULL, and the other available columns refers to the NON-NULL entity. I have following three options:
    1. To use one database table, which will have one unified column say ID, which will have PartID and GroupID data. But, in this case I won't be able to apply foreign key constraint, as this column will be containing both entities' data.
    2. To use one database table, which will have columns for both PartID and GroupID, which will contain the respective data. For each row, one of them will be NULL, But in this case I will be able to apply foreign key constraint.
    3. To use two database tables, which will have similar structure, the only difference will be the column PartID and GroupID. In this case I will be able to apply foreign key constraint.
    One thing to note here is that, the table(s) will be used in import processes to import about 30000 rows in one go and will also be heavily used in data retrieve operations. Also, the other columns will be used as pivot columns.
    Can someone please suggest what should be best approach to achieve this?
  2. Diamond2016 New Member

    Can someone please answer to this question?

Share This Page