There's a tool called Ldap Synchronization Connector (LSC)[/url] which is handy to do this. Just feed it a couple of SQL requests to get the data you want from your main tables, then map database fields to LDAP attributes, and LSC will keep your directory up-to-date. It compares entries on each run, so only updates what is needed. No more worries about the nitty-gritty of LDAP comparaisons or LDIF format!
It needs a JDBC connector to work (Java Database Connector), which you can get as a download at microsoft.com.
The tool is open source, and I've seen a few people using it in just this way before, with good feedback!