smacca
asked on
MS SQL Server database schema retrieval
I would like to retrieve the database schema and determine the following:
* User Tables
* Keys (primary keys, composite keys, no keys)
* Relationships (all types)
* Null possible
I am really desperate to retrieve this information and will award maximum points for solution.
Can someone please provide an example of how to retrieve the schema and the above information.
Cheers.
* User Tables
* Keys (primary keys, composite keys, no keys)
* Relationships (all types)
* Null possible
I am really desperate to retrieve this information and will award maximum points for solution.
Can someone please provide an example of how to retrieve the schema and the above information.
Cheers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Information_Schema.Tables where Table_Type = 'BASE TABLE'", cn");
DataTable dt = new DataTable();
da.Fill(dt);