Wednesday, March 7, 2012

Database Design Questions...

I am using SQL Server 2000.
I got two tables.
Table1:- PriceList
Column are ProductId(Primary Key) and rest of the column.
Table2:- PriceListHistory
Column are same columns as "PriceList" plus one more column to keep track of
change history.
I can add one more column to keep track of price change history and make
that as part of the primary key.
Questions is what should be the data type of this extra column. Can use data
type as datetime or use interger ? Is it not a
good idea to use datetime as part of the pimary key.
Any suggestions ?I'd go an integer with the identity property to make life very easy. Dates
as part of a PK can be problematic - dates can be reset on machines etc...
Also if 2 recs for the same part come in together they might get the same
time.
"Gary Smith" <GarySmith_77@.yahoo.com> wrote in message
news:OjkYNN81DHA.1760@.TK2MSFTNGP10.phx.gbl...
> I am using SQL Server 2000.
> I got two tables.
> Table1:- PriceList
> Column are ProductId(Primary Key) and rest of the column.
> Table2:- PriceListHistory
> Column are same columns as "PriceList" plus one more column to keep track
of
> change history.
> I can add one more column to keep track of price change history and make
> that as part of the primary key.
> Questions is what should be the data type of this extra column. Can use
data
> type as datetime or use interger ? Is it not a
> good idea to use datetime as part of the pimary key.
> Any suggestions ?
>

No comments:

Post a Comment