List of tables ordered by dependency

franzm
Posts: 1
Joined: 2025-10-23 08:24:28

List of tables ordered by dependency

Post by franzm »

Hi,

is there a command to list all tables of a database / schema ordered by dependency.

I only found the button "check foreign keys" within drop tables window:
2025-10-23 08_30_11-Drop database objects.png
2025-10-23 08_30_11-Drop database objects.png (19.97 KiB) Viewed 1756 times
But is there a command like WbListDependencies where I can have a similar list?

I tried

Code: Select all

-- also tried with  -catalog=...
WbListDependencies -schema=dbo -objectType=TABLE -name="*"
but got the error:

Code: Select all

No object named dbo."*" found!
Thanks in advance,
Franz
support
Site Admin
Posts: 98
Joined: 2023-07-15 15:58:37

Re: List of tables ordered by dependency

Post by support »

WbListDependencies shows the "usage" dependencies, e.g. views using a table.

What you want is the order for foreign keys. And for that you can generate scripts for INSERT, DELETE or DROP ordering using WbGenerateInsert, WbGenerateDelete or WbGenerateDrop
Post Reply