Date field doesn't seem to work in a multi column primary key
Posted on 2014-02-12
In a new table, I setup a multi-column primary key consisting of a CustomerId (int) field, SalesId (int) field and a MailingDate (date) field. However, this is not preventing me from adding duplicate records into the table.
I suspect that a column of data type date cannot be used in a multi-column key or that there is a time component to this field that is preventing uniqueness?
If true, can someone suggest an alternate method of preventing duplicate records in a table with the same Customer Id, Sales Id and Mailing Date.