![]() …but you can of course use it with any other database object such as dbo.ufnGetContactInformation. …and copied the result from the results pane (use text mode and set the ‘ Query‘ ‘ Options‘ -> ‘Results’ -> ‘Text’ -> ‘Maximum number of characters displayed in each column‘ to 8192 or some other generous figure) All I did to do this was to use the text: Note that schemas have been represented as folders. I’ve always been caught out by views so it would be nice to see those objects in the database that a view references. Let’s look at AdventureWorks, just so we can try things out. Data Modelling With Unified Modelling Language (UML) We’ll just stick to showing a subset of your database objects and the dependencies between them. PlantUML uses simple text-based instructions to render UML diagrams and these can be generated from SQL to show you such things as the intricacies of your database permission system, the foreign-key dependencies, or the details of your indexing strategy for a table. You can use your favourite editor via a command-line interface as well. I use AsciiDocFx, which installs the prerequisites for you (though you may need to set the path to your GraphViz install. If you want to use PlantUML from the command-line, there are install instructions here. If you use DocuWiki for documentation, there is an add-in for PlantUML, which is handy for teams since there is nothing to install on your machine then. There are several Atom packages that add PlantUML integration. Chrome has an Add-in that runs PlantUML called the UML Diagram Editor. With that, and the PlantUML manual, you should be well away with using this interesting application. To get you started, there is a little browser application here on the PlantUML site that allows you to type in PlantUML code and view the results. I will use TSQL code to create the PlantUML code directly. ![]() In this article I’m going to show how it can be used to easily generate class diagrams for database objects. For a relational database person who winces at the terms ‘class’ and ‘persistence’, even UML modelling has its uses as a way of communicating ideas and designs. There’s nothing to install on your computer (if you don’t want to) and it’s very easy to get started.Although you may have little urge to use UML diagrams in your everyday work, PlantUML is versatile enough to provide for a range of requirements. This might sound intimidating, and I thought so too at first, but it’s relatively simple. Along with DOT, I use Graphviz, which is a library of programs for converting the DOT code into the visual graph. My personal favorite is called DOT, which is a graph description language. I tried googling around, but it was hard to tell if “DOT” the language was different from “dot” the rendering layout engine (similar to neato, fdp, twopi). Warning: For any graphviz experts reading, I might get some terminology wrong here. There’s also tons of websites that offer tools for this. There’s tons of ways to do this…pen and paper, notepad, flowchart/diagramming software including both paid and free ones. This is something I do a lot when I’m tracing through code, or if I’m trying to work out a very basic structure of how something should work. To get a better idea of what I was looking at I decided to throw together a quick visual diagram. It spanned multiple databases on multiple servers. I was beginning to forget which things were calling other things. Today I was tracing through a chain of SQL stored procedures, tables, views, jobs, windows services, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |