开发者

Best tool to document T-SQL *source* files?

开发者 https://www.devze.com 2023-01-17 11:16 出处:网络
At work, the database is not documented at all. Furthermore, the stored procedures, functions and views are all encrypted, this rules out a lot of tools that document these objects for you. All I have

At work, the database is not documented at all. Furthermore, the stored procedures, functions and views are all encrypted, this rules out a lot of tools that document these objects for you. All I have are the plain .SQL files that generate the database, schemas, tables, functions and all.

I'd like to know, is there a tool that can read these files and generate a Doxygen-like documentation? Preferably open-source or freeware.

I found IzzySoft's HyperSQL and SourceForge's project PLDoc do something very close to what I'd need, though both seem to be very PL/SQL specific. I want something that reads SQL source files (that understands T-SQL's idiosyncracies), parses them, and gets me:

  • List of SPs, UDFs, etc. defined within each file
  • List of objects (both tables/views and procs/functions) each object depends on (directly and, if possible, also indirectly)
  • Calling and dependencies graphs (i.e. what calls what and is called by what)
  • If possible, when an SP uses a table/view, how's it using it (INSERT/DELETE/UPDATE/SELECT/mix???)

I've already developped a tiny Perl script that minimally parses these files attempting to get first point - but then it's just a h开发者_开发百科ack and lacks a lot of polish. I'm sure there must be a tool out there which does the job, I want to believe I won't have to code it myself.

Thanks in advance, Joe


We use Red Gate SQL Doc to generate ours.

However, it works from a database not files: it's easier to read everything from system tables (permission, dependecies, datatypes etc) than parse scripts. Parsing scripts is what the DB engine does...

Can you not generate an empty DB from the source files (remove WITH ENCRYPTION) and generate from that? Or decrypt if you have sa rights?

0

精彩评论

暂无评论...
验证码 换一张
取 消