A
Agnes
I got some table design problem and hope someone can give me advice.
I got an InvoiceTable with the primary key Invno, InvoiceChgtable will keep
the charges , noofunit, unitpirce.. etc, its primary key is using 'smallint'
with increment YES
Now, I need to keep each version of the invoice data in one history
database.
My problem is
1) Should I use store procedure to insert the previous verson data or
trigger rule ?
If using trigger rule ? How can I do that ? (I never use trigger
before )
2) If I want to keep the prevoius verson , How should I design the primary
in invoiceTable ?? Invoiceno with suffix? such as (INV0001-XX) XX is the
version ??
3) for some other tables, I got 3-relationship , parent , child and
grandchild, I got no idea how to design the primiary key in grandchild .
Sorry for a lot of stupid question.
Thanks in advance
I got an InvoiceTable with the primary key Invno, InvoiceChgtable will keep
the charges , noofunit, unitpirce.. etc, its primary key is using 'smallint'
with increment YES
Now, I need to keep each version of the invoice data in one history
database.
My problem is
1) Should I use store procedure to insert the previous verson data or
trigger rule ?
If using trigger rule ? How can I do that ? (I never use trigger
before )
2) If I want to keep the prevoius verson , How should I design the primary
in invoiceTable ?? Invoiceno with suffix? such as (INV0001-XX) XX is the
version ??
3) for some other tables, I got 3-relationship , parent , child and
grandchild, I got no idea how to design the primiary key in grandchild .
Sorry for a lot of stupid question.
Thanks in advance