Book a Demo

Author Topic: View SQL for the current diagram?  (Read 4118 times)

leonhardtk

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
View SQL for the current diagram?
« on: May 10, 2022, 03:42:16 am »
Is there a way to have Sparx EA reveal the SQL used to generate a particular diagram?
There are two reasons this would be helpful:
1.  To retrieve portions of specific diagrams (by name or types) for inclusion into MS Excel Pivot tables.
- for possible inclusion to fragments for document reports.
2.  As a learning tool to better the database object relationships

Appreciate any insight on how to view the SQL Sparx EA uses to display a particular diagram.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: View SQL for the current diagram?
« Reply #1 on: May 10, 2022, 08:15:42 am »
I heavily doubt that Sparx creates diagrams via SQL (so one never knows). But even a Sparxian would use the aid of a compiler to render diagrams.

q.-

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: View SQL for the current diagram?
« Reply #2 on: May 10, 2022, 02:28:10 pm »
If I'm looking for stuff like that I use SQL Server Profiler.

If you run that tool on SQL Server, it will catch each and every SQL command executed on the database.

In order to load the details of a single diagram, EA might execute tens, or even hundreds of queries

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: View SQL for the current diagram?
« Reply #3 on: May 10, 2022, 06:48:58 pm »
I probably got you wrong last night. The elements of a diagram are stored in t_diagramobjects with reference to t_diagram.diagram_id and the t_object.object_id. The tip of the iceberg that is...

q.

leonhardtk

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: View SQL for the current diagram?
« Reply #4 on: May 10, 2022, 11:13:57 pm »
Geert,

That is exactly what I was looking for!  I was just hoping there was a way to view that in system out by enabling enhance logging, or viewing stored procedures. 
It appears these are all embedded in binaries not in the database (for propriety reasons I'm sure).

I've been viewing the "queries" by opening (a copy) of my .eap file directly with Access...this is helpful for getting started and understanding the relationships... but still takes quite a bit off effort to recreate.

Thanks!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: View SQL for the current diagram?
« Reply #5 on: May 10, 2022, 11:59:14 pm »
You can also reverse engineer the database in EA.
And there the inside book by Thomas Kilian: https://leanpub.com/InsideEA

Most of it is fairly straightforward and self explanatory.
Some bits are a bit (or much) more obscure (e.g. information flows, diagram link path,...)

Geert