INSERT / UPDATE Query in same operation

J

JensB

Hi

This is a backend database for .NET application
Table1 is a linked table to a text file on the network, which is updated
from an ERP system.
Table2 is the table my application uses when the PC is offline.
I want to update Table2 with Table1 on those rows who exist in both tables,
and insert the new rows from Table1 into Table2,
in the same SQL call.
Is it possible at all?

Regards
JensB
 
J

Jerry Whittle

No. However you could put both queries in a macro or code and they would run
so fast that you wouldn't know the difference. You could even Set Warnings
off before the first query then Set Warnings on after the last. That way you
wouldn't even get bothered with the "You are ... x records" messages.
 
J

JensB

Jerry
Thks for answer
The issue about speed was also important, and you are right about error, it
is better to separate the call.
JensB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top