This can be done ?
UPDATE [email protected] SET fieldname1 = (SELECT fieldname2 FROM [email protected] WHERE tablename2.id = tablename1.id);
As it would be the sentence
Consult between 2 server
-
cybsistemas
- Posts: 118
- Joined: Mon 12 Sep 2005 17:31
- Location: Argentina
-
cybsistemas
- Posts: 118
- Joined: Mon 12 Sep 2005 17:31
- Location: Argentina
Yes, It can with engine Federated. (1,7 seconds)
But is faster that way:
MyConnectionLocal.Server: = 'localhost';
MyConnectionRemote.Server: = 'remote.dyndns.org;
MyCommandLocal.SQL.Text: = 'insert into tableLocal select Id, price from articles;
MyCommandLocal.SQL.Add ('where mark = true ');
MyCommandLocal.Execute; / / (5 records)
DumpLocal.Tablenames: = 'TableLocal;
DumpLocal.BackupToFile ('File.Sql');
DumpRemote.RestoreFromFile ('file.sql');
MyCommandRemote.Sql.Text: = update articles set price = select price from tableremote where articles.id = tableremote.id'
MyCommandRemote.Execute; / / (0,7 seconds)
But is faster that way:
MyConnectionLocal.Server: = 'localhost';
MyConnectionRemote.Server: = 'remote.dyndns.org;
MyCommandLocal.SQL.Text: = 'insert into tableLocal select Id, price from articles;
MyCommandLocal.SQL.Add ('where mark = true ');
MyCommandLocal.Execute; / / (5 records)
DumpLocal.Tablenames: = 'TableLocal;
DumpLocal.BackupToFile ('File.Sql');
DumpRemote.RestoreFromFile ('file.sql');
MyCommandRemote.Sql.Text: = update articles set price = select price from tableremote where articles.id = tableremote.id'
MyCommandRemote.Execute; / / (0,7 seconds)