P
P
protsey2018-06-01 15:25:15
Database
protsey, 2018-06-01 15:25:15

How to get a list of MSSQL dependent tables using a query?

Good afternoon. I collect several bases together, I struggle with the problem of duplicate keys. I'm trying to automate the process. I threw a program that changes keys and makes changes to dependent tables. At the moment, you have to manually enter the name of each table, etc., which is not convenient.
I would like to enter a query with the name of the table and get a list of tables that refer to it, something like "View Dependencies" in Management Studio, is this real? Google led me to a dead end, knowledge is not enough.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2018-06-01
@protsey

In principle, everything is in sysobjects and the studio extracts exactly from there
query structures are somewhat multi-level, it works
p / s / by delirium: sql profiler intercept the studio query to search for dependencies)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question