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

Posted on 2009-02-18
Last Modified: 2013-11-17
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.

Question by:Jsara
    LVL 84
    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 ...

    Author Comment

    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.
    LVL 84

    Accepted Solution

    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.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now