Link to home
Start Free TrialLog in
Avatar of Jsara
Jsara

asked on

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.

Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

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 ...
Avatar of Jsara
Jsara

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial