Please see my comment to the question and my questions. It's likely that you need to extract all the
database schema from the database:
http://en.wikipedia.org/wiki/Database_schema[
^].
Unfortunately, to best of my knowledge, the reflection of the schema is not a part of any SQL standard and depends on the particular database server. You would need to work with some particular server or have (or create) some common abstraction layer.
Please see:
http://msdn.microsoft.com/en-us/library/kcax58fh%28v=vs.110%29.aspx[
^].
Look at these open-source projects:
http://dbschemareader.codeplex.com[
^],
http://schemaspy.sourceforge.net[
^].
Sorry, only the first project is for .NET and written in C#, but the second one is not; it is written in Java, but it is very interesting; maybe it can give you some good ideas.
—SA