dbTalk Databases Forums  

Lookup or not Lookup?

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


Discuss Lookup or not Lookup? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
loic_nospam@yahoo.com
 
Posts: n/a

Default Lookup or not Lookup? - 07-12-2005 , 05:56 AM






Hi,

I hope someone can help.

I have a dts package in SQL Server 2000 with 2 connections. table A in
database 1, table A in database 2. Basically I want to update table A
in db1 with the data in db2 because db2 is more recent.

I want to pick the max date (from the date field) from table A db1 and
then extract all records from table A in db2 where the date is greater.

I am planning to use a lookup query but I am not sure this is the right
solution.

Hope this is clear.

Thanks in advance for any help,

Loic


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Lookup or not Lookup? - 07-12-2005 , 07:24 AM






Try this package design, no lookups required-

1 Exec SQL Task to query max data from db1..A, store result in global
variable
2 DataPump task of source select * from db2..A where datefield > ?, and set
the input parameter to the global variable from above. Set destination as
db1..A

--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

<loic_nospam (AT) yahoo (DOT) com> wrote

Quote:
Hi,

I hope someone can help.

I have a dts package in SQL Server 2000 with 2 connections. table A in
database 1, table A in database 2. Basically I want to update table A
in db1 with the data in db2 because db2 is more recent.

I want to pick the max date (from the date field) from table A db1 and
then extract all records from table A in db2 where the date is greater.

I am planning to use a lookup query but I am not sure this is the right
solution.

Hope this is clear.

Thanks in advance for any help,

Loic




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.