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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Can someone help with this...

Author  Topic 

Harry C
Posting Yak Master

148 Posts

Posted - 2002-05-14 : 13:48:21
I need to get data out of one DB into another through ASP. I have this so far, but I dont know where I am supposed to actually open up the connection to the DBs. Basically, I know how to do a Insert/Select, but I dont know how to do it with two different DB's, any thoughts? Thanks for takin a look

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-05-14 : 15:46:58
Say you are moving data from Server 1 to Server 2
Set up a linked server from Server 1 to Server 2

Then from your ASP you can simply call a stored procedure that executes a cross server insert from Server1 i.e. you only need to connect to Server1 in your ASP

insert Server2.database.dbo.table1
select database.dbo.table1

More details on setting up linked servers and distributed queries can be found on BOL as well as on this site (probably - haven't checked)

HTH
Jasper Smith

Go to Top of Page

Harry C
Posting Yak Master

148 Posts

Posted - 2002-05-14 : 17:00:38
Thanksw Jasper, I appreciate the help...

Go to Top of Page
   

- Advertisement -