Author Topic: EA - SQL to show hierarchy of packages?  (Read 19852 times)

BCGoitcwoodard

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
EA - SQL to show hierarchy of packages?
« on: April 06, 2024, 02:29:11 am »
Hi -  Can someone share a SQL (SQL Server) query to show the hierarchy of packages in a "project"?  A query to run against the Sparx repository.
Thank you,
CCW

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +564/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA - SQL to show hierarchy of packages?
« Reply #1 on: April 06, 2024, 02:44:14 am »
query t_package, and join on package_ID = parent_ID

Geert

BCGoitcwoodard

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: EA - SQL to show hierarchy of packages?
« Reply #2 on: April 06, 2024, 05:35:19 am »
Thanks.  And does t_object.ParentID for a column get you to the containing table's object_id?

And then the table's t_object.package_id get you to the containing package's package_id?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +564/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA - SQL to show hierarchy of packages?
« Reply #3 on: April 06, 2024, 05:47:15 pm »
Columns are stored in t_attribute

t_object.ParentID will give you the owning object.
t_object.Package_ID links to the owning package.

Geert

BCGoitcwoodard

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: EA - SQL to show hierarchy of packages?
« Reply #4 on: April 10, 2024, 12:34:42 am »
Thanks!