SQLServer - 如何在我的表上查找从属表?

SQLServer  - 如何在我的表上查找从属表?

问题描述:

使用 SQLServer

我有一个表 user


  • id

名称

/ code>

email

还有一些其他表(约200多个表),其中有些使用 作为外键在级联删除

There are some other tables (about 200 more tables), some of which use user.id as foreign key on cascade delete.

所以,我想知道 - 哪些表使用这个外键( user.id )?

So, I want to find out - Which tables use this foreign key (user.id) ?

使用 SQL Server Management Studio访问我的sql服务器

I am accessing my sql-server with SQL Server Management Studio.

SQL Server管理工作室,您可以右键单击对象资源管理器中的表,然后选择查看依赖关系。这将打开一个新窗口,您可以在其中查看依赖于您的表格的所有其他对象(而不仅仅是表格)。

In SQL server management studio, you can right click your table in the object explorer, and then select 'View Dependencies'. This will open a new window in which you can see all other objects (not just tables) that depend on your table, and on which your table depends.