Solved

MS SQL Server database schema retrieval

Posted on 2004-09-03
2
157 Views
Last Modified: 2010-07-27
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.
0
Comment
Question by:smacca
2 Comments
 
LVL 22

Accepted Solution

by:
mnasman earned 500 total points
ID: 11970927
Hello

  Here are few articles to help you for doing that

Retrieving Schema Information Using ADO.NET and C#
http://www.c-sharpcorner.com/Code/2004/July/OledbSchema.asp

Browsing MS SQL Server Desktop Engine using Information Schema
http://www.codeproject.com/cs/database/MSDEInfoSchema.asp

Retrieve Table Metadata
http://www.ftponline.com/vsm/2003_01/magazine/columns/databasedesign/

HTH
0
 
LVL 9

Expert Comment

by:glsac
ID: 11983020
SqlConnection cn = new SqlConnection("PutYourConnectionStringOverHere");
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Information_Schema.Tables where Table_Type = 'BASE TABLE'", cn");
DataTable dt = new DataTable();
da.Fill(dt);
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now