The way you are 'supposed' to sovle this in Moodle is to put the external db's primary key value in Moodle's user.idnumber field.
syncing id with external db
Well, I am doing that now. The problem is that I am using the External tool and when i launch it I need a way to map my userid to moodle's. The idnumber field unfortunately it not sent witht the Post back to my system..