问题
I have a table that when I click view dependencies, it shows less related tables than if I run the following T-SQL
EXEC sp_MSdependencies N'Item.Item', null, 1315327
There are three dependencies for three different tables that don't show up in the GUI. This wouldn't really be an issue for me but EFCorePowerTools is also not mapping those dependencies. So my question is - does anyone know what the Microsoft SSMS tool is using to visually show the dependencies when you right click and choose view dependencies? I need to figure out how some of my relationships are different than others. I made them all the same way and have tried removing and re-adding the ones in question. Recreating them makes no difference and they still don't show up. Any help is appreciated.
Update Thanks to someone from EFCorePowerTools, I have learned that Entity Framework Core is using sys.foreign_keys for the definition. When I query that table, I can't see anything that helps.
Image of Gui:
Image of EXEC sp_MSdependencies N'Item.Item', null, 1315327
回答1:
Here is what ssms does, when you click on view dependencies: https://www.mssqltips.com/tipimages/1294_sqlcode.txt
The other method, you can use to view dependencies by using INFORMATION_SCHEMA.ROUTINES or syscomments.
Tool which can help you to view dependencies is https://www.red-gate.com/products/sql-development/sql-dependency-tracker/
来源:https://stackoverflow.com/questions/53675738/microsoft-sql-server-foreign-key-dependencies-show-up-using-sp-msdependencies-bu