SELECT Shippers.*, Link.Address, Link.City, Link.Region, Link.PostalCode INTO NewShippers FROM Shippers JOIN LinkServer.DB.dbo.Shippers AS Link ON (Shippers.ShipperID = Link.ShipperID)
To lion_lh(xmanx) : 你给的方法好像不行
insert into a(id,name,cc,dd,ee,ff,gg) select a.id,a,name,a.cc,b.dd,b.ee,b.ff,b.gg from 主表 a inner join 从表 b on a.id=b.id
adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add('insert into SC(材料名称) select 材料名称 from 材料主表'); adoquery1.Open; 提示错误: 程序不支持从单一执行返回多个记录集。
adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Add('insert into SC(材料名称) select 材料名称 from 材料主表'); adoquery1.execsql;/////////////////不要用open
select * from 从表 where id = '001'
Link.Region, Link.PostalCode
INTO NewShippers
FROM Shippers
JOIN LinkServer.DB.dbo.Shippers AS Link
ON (Shippers.ShipperID = Link.ShipperID)
你给的方法好像不行
select a.id,a,name,a.cc,b.dd,b.ee,b.ff,b.gg from 主表 a
inner join 从表 b on a.id=b.id
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into SC(材料名称) select 材料名称 from 材料主表');
adoquery1.Open;
提示错误:
程序不支持从单一执行返回多个记录集。
adoquery1.SQL.Clear;
adoquery1.SQL.Add('insert into SC(材料名称) select 材料名称 from 材料主表');
adoquery1.execsql;/////////////////不要用open