Unless you have something which the application must supply all the time, I think it would be best to let the database related stuff be handled by the database itself.
This will allow you to have the DB to do all the heavy lifting, while allowing the application to remain as lightweight as possible so that it can handle whatever it is that the user needs doing.
EDIT: As per your comment.
From my experience, leaving all the calculations on the application, creates more problems then it solves. Unless the calculations you are doing belong exclusively to how will the data interact with the user, meaning that the application should handle all operations which deal with how will the data be presented to the user.
Doing any operations which strictly involves data, such as, get all the users with a given field, or as in your case, synchronization should be left at a DB level. This will allow you to:
Leave most of the heavy lifting at a DB level. DB's are usually good at what they do, so if you let them do their stuff, your application will be more lightweight (and most likely more responsive). This should in turn make the users happy because the application is not clunky.
Save resources: When you pull data from your DB, you are opening a connection and keep it open until you are done transferring data. Connections are expensive resources which should be used only when necessary. Pulling all the information in the DB so that you can operate on it, and then send it back means that the connection will be hogged for quite some time. If you have many applications using the DB, this could mean that the application will most likely not scale very well.
The above can lead to bandwidth issues if you have your application and DB running on different machines. This can make maintaining the application more expensive.
Having a stored procedure doing logic will provide you with better flexibility to apply changes. If you have the logic at a DB level, you can just make the change in one place to get the changes you need without having to issue a new application. This would then mean that you can be certain that all of your users are running the same logic, as opposed to having users running version
n of the application, while others running version
n + 1.