Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 create separate table for daily inventory?

Author  Topic 

joytwo0708
Starting Member

5 Posts

Posted - 2009-01-07 : 17:38:26
Is it good design to create separate table for daily inventory?
This way maybe tablediff.exe can be used to find the difference for different day's inventory?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-07 : 17:41:47
That is not a good design.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

joytwo0708
Starting Member

5 Posts

Posted - 2009-01-07 : 19:09:08
Any better design to keep the daily inventory?
I need to save the daily inventory because a delta report needs to be generated for different days.

How to save the data and how to do the delta report?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-07 : 23:37:03
You just need to have one table and put a column in it that contains the date. Then on queries, you'd select by date.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

joytwo0708
Starting Member

5 Posts

Posted - 2009-01-08 : 09:27:43
Hi Tara,

If put the daily inventory data into one table, then I cannot use tablediff.exe to find the difference.

Do you have the scripts to do the delta report and also save the delta report into another table (this delta report table will be sent to customer for them to see the difference)?

In the delta report table, probably need one status column (its value can be like "Add","Delete", "change-Old", "change-New".
For the changed record, need to present the original value and the new value to customer, "change-old" will be for the original value,
"change-new" will be for the new value). How to generete the delta report in this way?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-08 : 09:35:20
Same question asked and answered here http://www.sqlservercentral.com/Forums/Topic632016-361-1.aspx



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

joytwo0708
Starting Member

5 Posts

Posted - 2009-01-08 : 09:43:47
Peso,

I am glad you are on both forums. I am new to these SQL server forums, try to post in several places to get more opinions. Thanks a lot.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-08 : 09:46:29
As I read it, you got same opinion twice.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-08 : 09:57:50
quote:
Originally posted by joytwo0708

Hi Tara,

If put the daily inventory data into one table, then I cannot use tablediff.exe to find the difference.

Do you have the scripts to do the delta report and also save the delta report into another table (this delta report table will be sent to customer for them to see the difference)?

In the delta report table, probably need one status column (its value can be like "Add","Delete", "change-Old", "change-New".
For the changed record, need to present the original value and the new value to customer, "change-old" will be for the original value,
"change-new" will be for the new value). How to generete the delta report in this way?


for tracking change of status, you might need to create an audit table which requires a trigger for capturing changes in main table.
Go to Top of Page
   

- Advertisement -