/* -------------------- Create an oracle linked server --------------------*/ Exec Sp_addmediaserver @ Server = 'Orcl' , -- Orcl is the link server name in SQL @ srvproduct = 'Oracle' , -- Oracle fixed @ provider = 'Msdaora' , -- Msdaora fixed @ datasrc = 'Orcl' -- Datasrc local service name Go Exec Sp_add1_srvlogin 'Orcl' , False , 'Sa' , 'Scott' , 'Admin' -- SA is an SQL local Logon account, and POS/POS is an oracle Logon account. However, this statement does not help us. -- Test Select * From Orcl .. Scott. EMP -- Note uppercase/* ----------------------- create an sqlserver link server ------------------------------------*/ Exec Master. DBO. sp_addmediaserver @ Server = N '1970. 168.0.170' , @ Srvproduct = N 'SQL Server' Go Exec Sp_add1_srvlogin '1970. 168.0.170' , 'False' , 'Sa' , 'Sa' , '123' Go Select * From [192.168.0.170]. Pubs. DBO. Authors -- you can use DTS to create the table structure on the target Oracle/* ------------------------ import data ------------------------------------------------------*/ Select * From Orcl.. Scott. zx_nrinsert orcl... Scott. Authors Select * From Authors insert orcl... Scott. Employee Select * From Employee insert orcl..scott.jobs Select * From Jobs insert orcl... Scott. Stores Select *From Stores insert orcl... Scott. Sales Select * From [192.168.0.170]. Pubs. DBO. salesinsert orcl... Scott. zx_xx Select Top 100 WJ
From[192.168.0.170]. vsatdata. DBO. zx_xxWhereLx ='2'Insert orcl... Scott. zx_nrSelect Top10 *From[192.168.0.170]. vsatdata. DBO. zx_nr
where WJ in ( select top 100 WJ from [192.168.0.170]. vsatdata. DBO. zx_xx where Lx = '2' ) select top 10 * from [192.168.0.170]. vsatdata. DBO. zx_gp_nr