![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |