Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS - Update needed

Status
Not open for further replies.

jgurgen

Programmer
Mar 9, 2006
192
US
i have DTS set up to copy all new records from service.history to ifs.stagetable. Problem is that someone made a mistake after they entered data and now my stagetable has 4 entrys while the original has 3. Plus 2 of the entries are now incorrect. how can i set up the DTS to check where the databases are not equal and update those records? I have additional data in another table that is taken from the stagetable that also needs to be changed. Any idea how to change both tables to be the same as the original?
 
A pair of update queries joining the tables should do the trick. Which table is the 'gold standard' that you want everything else to match?

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
that would be the original (service.dbo.history)
other tables are (ifs.dbo.iprof_history , ifs.dbo.iprof_stagetable)
 
ONe option would be to just clear out the two 'mistake' tables and insert everything from service.dbo.history.

Otherwise, you could run an update query but it does not seem that you will have a good match for this approach in all cases.

Hope this helps,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
i would delete out both tables but i have data in ifs.dbo.iprof_history that isnt in the others and i cant lose that data. i guess a simple update will work though thanks.
 
Just make sure that you are joining on something when doing your update, so that it doesn't affect data that you want to leave untouched.

Good Luck,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top