In Visual Studio 2017, I can not make relations between tables using database diagram.
How to open database diagram in Visual Studio 2017?
Open a new database diagram Right-click the Database Diagrams node of your database in Object Explorer. From the drop-down menu, click New Database Diagram. In the Add Table dialog box, choose tables to work with in the diagram. The Database Diagram menu will be added to the main menu and the designer pane will open.
Database diagrams in xsd format can be opened in Visual Studio. I Created and worked with Database Diagram xsd format using Visual Studio 2019 (can do same in VS 2017) in the following manner: - Select main menu View > SQL Server Object Explorer to connect and view the desired SQL database objects.
To visualize a database, you can create one or more diagrams illustrating some or all of the tables, columns, keys, and relationships in it. You can open Database Diagram Designer by opening a new or existing diagram.
Applies to: SQL Server (all supported versions) Azure SQL Database Azure SQL Managed Instance Analytics Platform System (PDW) You can open database diagrams to view or edit the diagram's structure. In Object Explorer, expand the Database Diagrams folder. Double-click the name of the database diagram you want to open.
Database diagrams in xsd format can be opened in Visual Studio.
I Created and worked with Database Diagram xsd format using Visual Studio 2019 (can do same in VS 2017) in the following manner: -
As per this similar question on MSDN, the database diagrams have been deprecated after Visual Studio 2012.
The answer there provides two workarounds:
You can use SQL Server Management Studio (SSMS) to work with Database diagrams, here is a download link.
You can add a item (ADO.NET Entity Data Model) to project, it will create for you a .edmx file which contains a table with relation. More in here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With