I have been asked to look at the possibility of creating base classes in code from a sql server database (crazy considering I'm still learning oop).

To do this I need to be able to extract all :

table names
fields and data types
relationships
e.t.c

I know this is possible but have no idea where to start.

Can anyone give me a kick start or a kick if you want ?

How can I extract this info ?
What classes/methods will allow me do do the above ?

Not an easy one I know.