Create DB Diagram from existing triggers

  • I'm new here, so please go easy on me.

    I have an existing SQL2k database using triggers for referential integrity.

    I would like to know if there is a method of extracting these triggers and generating a database diagram to replace them.

  • Diagrams don't enforce referential integrity.  Primary and foreign keys do that.

     

    If you need a list of triggers, you can run this :

     

    SELECT Object_name(parent_obj) AS TblName, Name AS TrName FROM dbo.SysObjects where XType = 'TR' ORDER BY TblName, TrName

  • Thanks for that. I'm more used to Access where you build a diagram and create relationships...just assumed that SQL would be able to do the same thing.

    Other than a graphical view of the database does a diagram actually do anything ?

    What alternative is there to using a trigger?

  • Well in the graph you can do some minute modifications.  Relations being one of them.  But my favorite is scripting it out in QA and running it.  Another alternative would be to use Enterprise manager and edit the relations from the table (edit table, relations).

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply