What algorithms are known to perform the task of updating a database by inserting, updating, and deleting rows in the presence of database constraints?
More specifically
OpenDbDiff has source code available. You could look at that and figure out the algorithms.
http://opendbiff.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25206