Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Cross Platform sql in .net

Author  Topic 

dev1aspnet
Starting Member

2 Posts

Posted - 2007-03-20 : 22:53:52
Hi,

I have an as400 table that I would like to backup to a sql server table.. I'd like to do something as easy as

insert into sqlserver.table select * from as400.table

but it doesnt look like this is possible.. I'm using c# and can open connections to both independently but dont want to query from one and insert into the other during the dataset loop.. there are 300k + records..

Any ideas on how I can accompish the above?


Thanks in advance for your help.

Andraax
Aged Yak Warrior

790 Posts

Posted - 2007-03-21 : 05:14:46
You'll need to set up a linked server or use OPENROWSET to be able to run that sort of query. I think you'll have to find a 3rd part OLE DB provider for DB2 or use Host Integration Server.

Also... you should be able to do it in C#. 300k ain't that much, unless you have demands for high performance...

Go to Top of Page

dev1aspnet
Starting Member

2 Posts

Posted - 2007-03-21 : 18:59:16
Thanks for the response.. I do have an OLE DB connection setup with db2.. I just cant open a connection to both at the same time in my c# method... What I would need to do is open the db2 connection and query the rows... during the loop I would have to call an insert into sqlserver... which would place 300k+ inserts...

I'd like to issue one statement which is a select * from one and insert into another but I dont think its possible..

I havent heard of the openrowset approach (I'll look this up) and have looked into the linked server technique but dont know if it has to be run from a sql server stored procedure or not.. All of our backups are going thru a .net scheduling app and I'd like to run this one thru a page in that app as well (if possible)..
Go to Top of Page
   

- Advertisement -