dbTalk Databases Forums  

Lookups

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


Discuss Lookups in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
A.B.
 
Posts: n/a

Default Lookups - 06-27-2006 , 12:12 PM






I have a large table and i am trying to find a way to import only the new
records into SQL Server 2000. Once the records are in the table they are not
updated so i can use the date and time fields to find what is the most recent
record that is not a problem. The problem is how do i use the DTS to only
import the records after this date and time. Should i be using a lookup and
if so how would i use the lookup in the SQL statement? Also do i need to make
a lookup for each field, date and time, or can this be one lookup? Any advice
would be helpfull and if more information is needed let me know.

Thanks

Reply With Quote
  #2  
Old   
Matt
 
Posts: n/a

Default RE: Lookups - 06-27-2006 , 08:21 PM






If you only want to select records that have date/time value after a
specified date/time, the easiest place to put that logic would be in the
source query. You should be able to code your source query so that it is
only selecting the records that have a date/time value greater than a
specified date/time value.

e.g.
SELCT *
FROM TableA
WHERE Last_Updated_Date > '6/20/2006'

This statement would select all records from TableA that have a
Last_Updated_Date value after '6/20/2006'.

"A.B." wrote:

Quote:
I have a large table and i am trying to find a way to import only the new
records into SQL Server 2000. Once the records are in the table they are not
updated so i can use the date and time fields to find what is the most recent
record that is not a problem. The problem is how do i use the DTS to only
import the records after this date and time. Should i be using a lookup and
if so how would i use the lookup in the SQL statement? Also do i need to make
a lookup for each field, date and time, or can this be one lookup? Any advice
would be helpfull and if more information is needed let me know.

Thanks

Reply With Quote
  #3  
Old   
A.B.
 
Posts: n/a

Default RE: Lookups - 06-28-2006 , 07:26 AM



Thank you for your response. The thing is that i need to get the date and
time from the SQL Server then us it in the source query. That is why i am
looking into lookups, since the query is involving two seperate databases.

thanks

"Matt" wrote:

Quote:
If you only want to select records that have date/time value after a
specified date/time, the easiest place to put that logic would be in the
source query. You should be able to code your source query so that it is
only selecting the records that have a date/time value greater than a
specified date/time value.

e.g.
SELCT *
FROM TableA
WHERE Last_Updated_Date > '6/20/2006'

This statement would select all records from TableA that have a
Last_Updated_Date value after '6/20/2006'.

"A.B." wrote:

I have a large table and i am trying to find a way to import only the new
records into SQL Server 2000. Once the records are in the table they are not
updated so i can use the date and time fields to find what is the most recent
record that is not a problem. The problem is how do i use the DTS to only
import the records after this date and time. Should i be using a lookup and
if so how would i use the lookup in the SQL statement? Also do i need to make
a lookup for each field, date and time, or can this be one lookup? Any advice
would be helpfull and if more information is needed let me know.

Thanks

Reply With Quote
  #4  
Old   
Chris Chilvers
 
Posts: n/a

Default Re: Lookups - 06-28-2006 , 12:19 PM



You could use two data tasks, the first extracts the date/time and
stores it in a variable.

The second query can then use this variable as a parameter in the query.

On Wed, 28 Jun 2006 05:26:01 -0700, A.B. <AB (AT) discussions (DOT) microsoft.com>
wrote:

Quote:
Thank you for your response. The thing is that i need to get the date and
time from the SQL Server then us it in the source query. That is why i am
looking into lookups, since the query is involving two seperate databases.

thanks

"Matt" wrote:

If you only want to select records that have date/time value after a
specified date/time, the easiest place to put that logic would be in the
source query. You should be able to code your source query so that it is
only selecting the records that have a date/time value greater than a
specified date/time value.

e.g.
SELCT *
FROM TableA
WHERE Last_Updated_Date > '6/20/2006'

This statement would select all records from TableA that have a
Last_Updated_Date value after '6/20/2006'.

"A.B." wrote:

I have a large table and i am trying to find a way to import only the new
records into SQL Server 2000. Once the records are in the table they are not
updated so i can use the date and time fields to find what is the most recent
record that is not a problem. The problem is how do i use the DTS to only
import the records after this date and time. Should i be using a lookup and
if so how would i use the lookup in the SQL statement? Also do i need to make
a lookup for each field, date and time, or can this be one lookup? Any advice
would be helpfull and if more information is needed let me know.

Thanks

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.