dbTalk Databases Forums  

Transfer data between 2 SQL Server 2000 Instances.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Transfer data between 2 SQL Server 2000 Instances. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim
 
Posts: n/a

Default Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 07:43 AM






I am setting up a DTS packet that looks at a view on one SQL Server
instance and uses a query to insert data, in a table, on another SQL
server instance. Anyone, know of a way to do this?


Thanks


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 12:56 PM






If I understand you correctly then you can use as the SourceSQLStatement
of the DataPump task (Use a Query instead of a table object) the query
you want

SELECT <col list> from VIEW

You set up one connection object as the Source SQL Server and another as
the destination SQL Server.

Allan

"Tim" <Timothy.Juarez (AT) Ipaper (DOT) com> wrote


Quote:
I am setting up a DTS packet that looks at a view on one SQL Server
instance and uses a query to insert data, in a table, on another SQL
server instance. Anyone, know of a way to do this?


Thanks


Reply With Quote
  #3  
Old   
Timothy Juarez
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 01:33 PM



Okay,

I looked up datapump task through the help files and found nada. Here
is what I am trying to do:

1. Open a view to get the recordset in the view. The view resides on
instance SQL1.

2. Take said recordset and use a particular field for a conditional ie.
if recordset is null, then run an insert query saying, no records. Else
insert information, from the above view on instance SQL2. The Two
instances, actually reside on the same server.


Thanks for giving me a hand on this.

Timothy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 02:07 PM



Have a look at this article then, although dealing with text files it
does give an introduction to DTS.

Building a Package in the DTS Designer
(http://www.sqldts.com/default.aspx?278)



"Timothy Juarez" <timothy.juarez (AT) ipaper (DOT) com> wrote


Quote:
Okay,

I looked up datapump task through the help files and found nada. Here
is what I am trying to do:

1. Open a view to get the recordset in the view. The view resides on
instance SQL1.

2. Take said recordset and use a particular field for a conditional ie.
if recordset is null, then run an insert query saying, no records. Else
insert information, from the above view on instance SQL2. The Two
instances, actually reside on the same server.


Thanks for giving me a hand on this.

Timothy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #5  
Old   
Timothy Juarez
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 02:48 PM



I set up the packet for the Data Pump Task but I am not directly
dropping the information in, this is more of what I what to do.

Insert into SQL1.database1.dbo.table1( field1, field2, field3, field4,
field5)
Values (constant1, SQL2.database1.dbo.table1.field1, getdate(),
SQL2.database2.dbo.table2.field2, SQL2.database2.dbo.table2.field3)


So far, I haven't seen a way to do this yet.


Timothy Juarez


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 03:28 PM



OK

You do not want to do it like this.

Try this

On "SQL 2" you create a view which does exactly this

" constant1, SQL2.database1.dbo.table1.field1,
getdate(),SQL2.database2.dbo.table2.field2,
SQL2.database2.dbo.table2.field3"

You then setup a connection to SQL 2 and use this as the source. Set up
a connection to SQL1 and use this as a destination. In the Transform
Data task you use your view as the Source Statement.

Make sense?

Allan




"Timothy Juarez" <timothy.juarez (AT) ipaper (DOT) com> wrote


Quote:
I set up the packet for the Data Pump Task but I am not directly
dropping the information in, this is more of what I what to do.

Insert into SQL1.database1.dbo.table1( field1, field2, field3, field4,
field5)
Values (constant1, SQL2.database1.dbo.table1.field1, getdate(),
SQL2.database2.dbo.table2.field2, SQL2.database2.dbo.table2.field3)


So far, I haven't seen a way to do this yet.


Timothy Juarez


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #7  
Old   
Timothy Juarez
 
Posts: n/a

Default Re: Transfer data between 2 SQL Server 2000 Instances. - 03-10-2005 , 03:53 PM




Yep, makes perfect sense.


Thanks for all the help.


Timothy Juarez


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.