Hey guys, I run SQL Server on a local machine. But our main database is a Oracle database located elsewhere. I use openqueries a lot, but I need to do a insert statement on one of the tables. I am trying to figure out how to insert into a table onto the Oracle database through the openquery. I am trying to insert data from another table. Example,
insert into table1
select * from table2
I know insert openquery(myoracle, 'select * from table1') values ('10') works. But I need to copy a large amount of information from another table.
I tried insert openquery(myoracle,
insert into table1
select * from table2) and it does not work. Do you guys know how to make this work? Or maybe some workaround?
The reason I do the OQ way is because I use C# to call stored procedures from the SQL server database. Which, in turn, calls openqueries to get data from the Oracle database. I pull the small amount of information I need and then do whatever manipulation needed to create a report and export into excel. Thanks.
insert into table1
select * from table2
I know insert openquery(myoracle, 'select * from table1') values ('10') works. But I need to copy a large amount of information from another table.
I tried insert openquery(myoracle,
insert into table1
select * from table2) and it does not work. Do you guys know how to make this work? Or maybe some workaround?
The reason I do the OQ way is because I use C# to call stored procedures from the SQL server database. Which, in turn, calls openqueries to get data from the Oracle database. I pull the small amount of information I need and then do whatever manipulation needed to create a report and export into excel. Thanks.