Is there a way to programmatically add new code to database design

Hi

I want to add a few lines of code to all fields in my database. Is there a way (perhaps with the API?) of doing this programmatically?

TIA

Phil