Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 obtain new and updated records

Author  Topic 

petebob796
Starting Member

35 Posts

Posted - 2008-09-08 : 22:38:13
I work at a college and am looking to export student records from out student management system to another sytem. The requirements are to export all new student records and any that have been updated (any field) since the last run.

So I started to set this up with select statement and table (simplified);
acad_period student_id forename surname dob address1....

so obviously each record is added to the table to record what is generated and output. The next time I would like to be able to obtain the changes and new records.

It seems inelegant to join this table to my initial select statement on every field considering the number of columns in the real table. Is there a better way to do this?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-26 : 04:08:24
Do you have a column denoting some status (export) ?
if you do, just select the records where status column for export is null.
after export, update all null columns to getdate().



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-26 : 04:12:29
quote:
Originally posted by petebob796

I work at a college and am looking to export student records from out student management system to another sytem. The requirements are to export all new student records and any that have been updated (any field) since the last run.

So I started to set this up with select statement and table (simplified);
acad_period student_id forename surname dob address1....

so obviously each record is added to the table to record what is generated and output. The next time I would like to be able to obtain the changes and new records.

It seems inelegant to join this table to my initial select statement on every field considering the number of columns in the real table. Is there a better way to do this?


do you have date column in your table like dateadded,datemodified etc. this will wnable you identify incremental data for exporting each time.
Go to Top of Page
   

- Advertisement -