Dont touch the SQL Database! Use the VI API for your scripting or programming language of your choice to gathering such information. The VirtualMachine Object contains these and much more informations.
Regards
Joerg
'Remember if you found this or others answers helpful do not forget to award points by marking an answer as helpful or correct'