Netherworld
Technical User
I have inherited a database where system changes are tracked. We receive drafts of these changes. Many times, these changes have multiple drafts. Originally, the users would enter a new record when a subsequent draft would come in.
Once a new draft is received, we no longer need to continue working with the prior draft but don't want to delete it completely. We have set up a table to house historical data on drafts and only want to keep the current draft in the main table.
The primary key is a combination of Change and Draft:
Change Draft
AAAA 1
AAAA 2
BBBB 1
CCCC 1
DDDD 1
DDDD 2
DDDD 3
EEEE 1
I need two separate things to happen here.
1) I want to rid the main table of all the old drafts while keeping the latest drafts.
2) I want to append the old drafts to the historical table excluding the latest drafts.
I am new to SQL, so use the "Dummies" language please!
Thank you!!!
Once a new draft is received, we no longer need to continue working with the prior draft but don't want to delete it completely. We have set up a table to house historical data on drafts and only want to keep the current draft in the main table.
The primary key is a combination of Change and Draft:
Change Draft
AAAA 1
AAAA 2
BBBB 1
CCCC 1
DDDD 1
DDDD 2
DDDD 3
EEEE 1
I need two separate things to happen here.
1) I want to rid the main table of all the old drafts while keeping the latest drafts.
2) I want to append the old drafts to the historical table excluding the latest drafts.
I am new to SQL, so use the "Dummies" language please!
Thank you!!!