re.
re.

Reputation: 75

Best Practice append, Insert into Table . Queries

Hi trying to acknowledge the best practice to update Insert data from A table A to Table B . I have ADOConnection1 Table Clientes and ADOConnection2 Table Q_Clientes Now i knead to update

ADOConnection1 Table Clientes \Q_Clientes has the same similar to Clientes only it´s in another Locacion i can call clientes.FieldByName('Localização').text := Q_Clientes.FieldByName('Localização').text; .......................................... .......................................... ..........................................

or is there a simple Way to update Table Clientes .

Thank´s

Upvotes: 0

Views: 526

Answers (2)

Fabricio Araujo
Fabricio Araujo

Reputation: 3820

Depending on what database you connect, you can something like UPDATE..FROM (SQL Server) or use a SP for that.

Upvotes: 1

Leslie
Leslie

Reputation: 3644

you can do that in a query:

INSERT INTO TABLE1 
(SELECT * FROM TABLE2 T2 
LEFT OUTER JOIN TABLE1 T1 on T2.IDField = T1.IDField 
WHERE T1.SomeOtherField is null)

Upvotes: 1

Related Questions