If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > data from db1 to db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-28-06, 02:54
faamugol faamugol is offline
Registered User
 
Join Date: Mar 2004
Posts: 58
data from db1 to db2

Hi,

I use SQL Server database and ASP

I have 3 views from 3 different databases:

V_Company1 from db1
V_ Company2 from db2
V_ Company3 from db3

I have created an other database where I want to Insert the result of the 3 views in a table named T_result from db4

Can anyone help me
Reply With Quote
  #2 (permalink)  
Old 07-28-06, 12:42
csamuels csamuels is offline
Registered User
 
Join Date: Mar 2006
Location: south jersey, usa
Posts: 53
open a connection to db4. objconn4

open a connection to db1. objconn

execute select query on objconn

execute insert query on objconn4

close connection to objconn

open connection to next db. objconn. repeat for all



with this code you can change the sqldb var to easily change between dbs
Code:
dim sqlserver, sqluser, sqlpwd, sqldb
dim sconn, srs

  set sconn = CreateObject("ADODB.Connection") 'prep connection'
  set srs = CreateObject("ADODB.Recordset") ' prep recordset'
  sconn.open "PROVIDER=SQLOLEDB;DATA SOURCE=" & sqlserver & ";UID=" & sqluser &_
             ";PWD=" & sqlpwd & ";DATABASE=" & sqldb
__________________
"They say Moses split the Red Sea
I split the blunt and rolled the fat one, I'm deadly"
-- Tupac 'Blasphemy'
Reply With Quote
  #3 (permalink)  
Old 07-29-06, 09:56
faamugol faamugol is offline
Registered User
 
Join Date: Mar 2004
Posts: 58
thank you csamuels and others,

I tried it it seems to work but only I have huge tables with 400.000 records for each table.

I have the error message: server time out (sql server). I set all the parmeters to 0, so the time is illimited as you know for the value 0.

I read something about updating using a batch or parchage but I have not enough information in order to use it.
may anyone help me to solve this.

Is there any way to solve this probleme??

Thans ks in adavance for your help
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On