Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to visualize database tables schema in VS

How do I display that schema of tables in my database and foreign keys that links them in VS ?

Example of such schema is used in this question mattlant's answer.

like image 450
Rasto Avatar asked Jul 24 '10 22:07

Rasto


People also ask

How do I view schema in Visual Studio?

You can access the XML Schema Explorer from a . vb file that has a Visual Basic XML literal associated with an . xsd file. To see the schema set in the XML Schema Explorer, right-click an XML node in an XML literal or an XML namespace import and select the Show in Schema Explorer command.

How do I view a database schema?

You can get a list of the schemas using an SSMS or T-SQL query. To do this in SSMS, you would connect to the SQL instance, expand the SQL database and view the schemas under the security folder. Alternatively, you could use the sys. schemas to get a list of database schemas and their respective owners.

How do I view a database table in Visual Studio?

To connect to a database instance In Visual Studio, make sure that SQL Server Object Explorer is open. If it is not, click the View menu and select SQL Server Object Explorer. Right-click the SQL Server node in SQL Server Object Explorer and select Add SQL Server.

How do I view a table in a schema?

The easiest way to find all tables in SQL is to query the INFORMATION_SCHEMA views. You do this by specifying the information schema, then the “tables” view. Here's an example. SELECT table_name, table_schema, table_type FROM information_schema.


1 Answers

They can be done through Visual Studio or the Sql Server Management Studio.

In visual studio just open the "Server Explorer" window, right-click on the Database Diagrams folder (under the db you want), and choose "Add Database Diagram", just drag-and-drop the tables you want onto the diagram.

Through Sql Server management studio there done the same way (just without the server explorer window).

like image 164
gillyb Avatar answered Oct 04 '22 05:10

gillyb