T-SQL Puzzler - Crawling Object Dependencies

前端 未结 2 1805
面向向阳花
面向向阳花 2021-02-06 19:19

This code involves a recursive Stored Procedure call and a \"not so great\" method of avoiding cursor name collision. In the end I don\'t care if it uses cursors or not. Just lo

2条回答
  •  自闭症患者
    2021-02-06 19:44

    See this Stackoverflow question for a discussion of sorting querying table foreign key dependencies by depth - which is a similar problem to the one you're discussing. There are at least two working solutions to that problem in the answers and the only real difference to what you're doing is the tables they're crawling. This posting has a DB reverse engineering script that shows how to use a lot of the main data dictionary tables.

提交回复
热议问题