One of the things about the sys.dm_sql_referenced_entities()
system dynamic management function is that you can use it on cross-database and cross-server entities.
This means you can find referenced entities that are in a different database and even on a different server.
This article provides an example of sys.dm_sql_referenced_entities()
returning a stored procedure that queries a database on a linked server.