Re: Using TADOQuery for select using two tables
Hi!
I need to put some data that are on a table on server 1 to other table on
server 2.
Some data may be alread on the server 2, and because I want to let the
user chose, from the data on server 1 that is not yet on the server 2, I
think of use something like this:
On ADOQuery1 (Connection to server 1, DataSource -> DataSource1)
SELECT a, b
FROM table1
WHERE (v = 0)
AND
(a <> :a2)
On ADOQuery2 (Connection to server 2)
SELECT * FROM table2
On DataSource1
DataSet -> ADOQuery2
The problem is that way, The only record that is alread on server 2 that
do not appear on my select is the first, the others continue to appear.
How can I make may select return ONLY the records in table1 that are not
in table2?
Thanks for any help!
Select * from Table1
where keyField not in (Select keyField from Table2)
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
Relevant Pages
- Re: MS SQL copy new and modified rows from TABLE1 to TABLE2
... However Table1 is dynamic it has new rows added and some old rows ... How can I continue to keep Table2 up to date without always having to ... If the tables are on the same server, a trigger would be the best way ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... (comp.databases.ms-sqlserver) - DataAdapter.Update() doesnt work
... I have created a Dataset containing two tables "Table1" and "Table2" ... If I make a change to a field in "Table1", I call the AcceptChanges() ... nothing about updating the server with the changes. ... (microsoft.public.dotnet.framework.adonet) - Re: Using TADOQuery for select using two tables
... I need to put some data that are on a table on server 1 to other table on server 2. ... On ADOQuery2 ... The problem is that way, The only record that is alread on server 2 that do not appear on my select is the first, the others continue to appear. ... WEll there a number of ways to accomplish depending on the SQL server you are using for example in MSSQL server you can have cross DB queries and linked servers that you can use any database on any server through a single connection and you are not required to have two Connection objects on your form. ... (borland.public.delphi.database.ado) - Re: Finding a record in a TADOTable
... You are telling me that instead of reading in all ... The exact SQL depends on what server you are using but something like this ... Set targetField = B.TargetField ... Insert into Table1 ... (borland.public.delphi.database.ado) - RE: Handling multiple result sets
... TableMappings, you can give these tables real names. ... Table and Table1. ... > I have a stored procedure that returns two sets of> data. ... > Is it possible to handle these two results within a single call to the sql> server, as I do not want to have to do a second return trip to the server> ... (microsoft.public.dotnet.framework.adonet) |
|