Can we create multicolumn unique indexes on MS access databases? -
We want to prevent duplication of records in our MS Access database by using a multicolumn unique index. Due to how data is sent (through the network), duplicate data is sometimes received. The data source does not send a unique ID, so the easiest option is to prevent duplicate records from being placed. According to
:
With multicolumn unique indexes, the index guarantees that each combination of values in the index key is unique. For example, if a unique index LastName , FirstName, and MiddleName columns, any two rows in the table can not have the same combination of values for these columns.
This is for SQL 2005, so I'm not sure that it is possible to use MS Access.
I think a choice is probably to use the query (pseudo-code):
('x', 'y', 'z') where (a & Lt; & gt; 'x') and (b & gt; & gt; 'Y') and (c & lt); & Gt; 'Z')
... but I think an index would be better. Open the table in the Design view in MS Access, select the three columns that you want to create in the unique index:
, And then click on the small key on the toolbar. You do not have a zero value in the primary key.
Comments
Post a Comment