indexing in a table

  • Thread starter Thread starter sdg8481
  • Start date Start date
S

sdg8481

Hi,

Can anyone confirm (or deny) that when indexing in a table is set to 'Yes -
No Duplicates' and then you try and append data from a sorted query into that
table, DOES THE TABLE ALWAYS ACCEPT THE FIRST ROW (as sorted by the query) or
is it more random than that.

thanks

S
 
On Sun, 28 Feb 2010 14:19:01 -0800, sdg8481

SQL is not random. In fact it is firmly rooted in mathematical set
theory, and all its operations are 100% predictable.
If you meant to ask "I have another table that has data that would
violate the unique index; what happens when I append that data to this
table with unique index?" I would expect that indeed the first rows
would make it to the table. If you wanted to be sure, you would change
your query to only select those "first" records. Techniques like
"select * from Orders where OrderDate = (select Min(OrderDate) from
Orders O2 where O2.CustomerID = Orders.CustomerID)" can be used.

-Tom.
Microsoft Access MVP
 
Back
Top