sql server - optimize query that compares two tables with similar schema in different databases -


Hi I have two different tables with the same schema in different databases. I record between these two tables What is the best way to compare me? I should find out the records in the first table whose closing record is not present in the second table, recording with some records from the first table, where there is nothing but so far This SQL Numerology Came up with the training I

  table, select the 1 t1_col1, t1_ col2 where t1_col1 = & lt; Condition & gt; And t1_col2 = & lt; & Gt;   

P> This question above seems fine but I suspect that it is queuing the line by comparing the row without evaluating the conditions in the first part of the query because the result of the first part of the query will be very low.

Just use keywords except !!!

  Select table 1 to t1_col1, t1_ col2 where t1_col1 = & lt; Condition & gt; And t1_col2 = & lt; Condition & gt; Except SELECT T2_col1, t2_ col2, the table 2   

query returns any specific value EXCEPT to the left of the operator that does not return from the correct query. For more information on



Comments