question about best practice of Update query on MS Access local table and SQL serever linked table..

We have update queries in the system designed using the query grid,
where the data from a local MS Access table is set to update it to the sqlserver linked table.
I am curious to know which would be the best method

a) whether to use join in the update query like below and not having the where clause since join is already set on the ids belonging to both tables

UPDATE [Children-local] INNER JOIN Children ON [Children-local].childid = Children.childid SET Children.firstname = [Children-local].firstname, Children.middlename = [children-local].middlename, Children.lastname = [children-local].lastname;

2) Or to use the update query without setting the joins but specify the where clause criteria
like below
UPDATE Children, [Children-local] SET Children.firstname = [Children-local].firstname, Children.middlename = [children-local].middlename, Children.lastname = [children-local].lastname
WHERE (((Children.childid)=[children-local].[childid]));


Would the peformance matter if you are using join vs where clause and which is the best method.

JsaraAsked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
No. As I indicated earlier, the server will build an "execution plan" based on the tables, fields, indexes etc etc ... in the case of otherwise identical queries, except one uses Joins while the other uses Where, the server will almost certainly generate the same execution plan, which means that the server will do exactly the same thing. Of course, there is no guarantee of this.

That said, there are opposing schools of thought on this. Some firmly believe you should use Joins at all times, others think that Joins are resource intensive, etc etc ... if you search for this topic, you'll find intense debates and rhetoric on both sides of the battle.

There is a definite art to building good queries, and the only way to determine if a query is better off with a Where clause or a Join (if at all) is to build it both ways and then time both.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
From a performance perspective, there is probably no difference. The query parser will determine the execution plan used, and in the case of identical queries - with the exception of Joins vs Where - the server will almost certainly use the same execution plan for both.

So it comes down to a matter of syntax preference. Many people have difficulties deciphering Join clauses (myself included), and prefer the Where approach ...
0
 
JsaraAuthor Commented:
Is it true that using the joins the query needs to process more - to make sure and check the related
records from two sides hence it takes longer as supposed to just using a where clause.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.