You may want to create a custom content action/edit handler extension
http://ezpedia.org/wiki/en/ez/content_action_handlers http://ezpedia.org/wiki/en/ez/content_edit_handlers
You may prefer to create a custom module extension instead, there are examples of modules which provide the type of functionality your looking for. An example of this might be found in the ezadmin extension.
http://pubsvn.ez.no/community/trunk/extension/ezadmin/modules/admin/ http://pubsvn.ez.no/community/trunk/extension/ezadmin/modules/admin/sqlquery.php
This one might be usefull for you: http://ez.no/community/contribs/applications/extension_manager
;) ++
--
There were these two cows, chatting over the fence between their fields.
The first cow said, "I tell you, this mad-cow-disease is really pretty scary. Don't you think ?"
The other cow replies, "Hell, I ain't worried, I'm a duck !"