This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / .NET 问题? 请问在.NET里如何把一个DATABASE TABLE的数据INSERT到另一个DATABASE的TABLE里?我是指用SQLCOMMAND和SQLCONNECTION语句。
-ttaaoo(tao);
2005-2-12
(#2121047@0)
-
Anyone knows?
-ttaaoo(tao);
2005-2-12
(#2121057@0)
-
这和.net无关呀,用标准的SQL就行: insert totable (f1,f2) select f1,f2 from fromtable 作为sqlcommand,其它都照旧.
-armstrong2(动动猴他爸);
2005-2-12
(#2121100@0)
-
可是SQLCONNECTION是两个DATABASE CONNECTION?我没写过两个DATABASE CONNECTION的语句。
-ttaaoo(tao);
2005-2-12
(#2121145@0)
-
可以在分别取出数据之后,把两个dataset 进行merge。
-luoboyang(萝卜秧);
2005-2-12
(#2121271@0)
-
what do you mean "SQLCONNECTION是两个DATABASE CONNECTION"?
-guestagain(guest again);
2005-2-12
(#2121685@0)
-
用一条语句实现, 你需要db link, 以oracle-oracle为例connect to server1:
insert into table1 (col1,...coln) select col1,...coln from table2@server2
如果是sqlserver-sqlserver (or sybase-sybase):
insert into table1 (col1,...coln) select col1,...coln from server2.dbname.dbo.table2
前提是配置db link (oracle) 或 linked server (sqlserver/sybase or sybase-sybase), 配置某些 heterogeneouse db link 需要安装gateway, 比如oracle-sqlserver.
-whatwhenwherewhy(一生何求);
2005-2-13
{384}
(#2122946@0)
-
But that has nothing to do with .NET, right? :)
-jchonc(James);
2005-2-15
(#2126297@0)
-
yeah. it's DBA thing.
-whatwhenwherewhy(一生何求);
2005-2-15
(#2126416@0)