Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract documentation strings from SQL Scripts [closed]

How can I best extract the documentation strings from T/SQL scripts and present them as a user-frienfly API documentation? I know about tools like Doxygen, Javadocs or Sphinx, but none of them seem to know about SQL.

For example, I want to be able to make use of the documentation in scripts that contain create statements like follows:

/**
 * This is a stored procedure.
 *
 * @param foo foo does bar
 */
create procedure my_proc(foo varchar(100)
...
GO
like image 460
Behrang Avatar asked Dec 15 '10 12:12

Behrang


2 Answers

You should try Natural Docs to document SQL-procedures. It is open-source, really straight forward and well documented. An example would look like

/**
 * This is a stored procedure.
 *
 * Parameters:
 *   foo - foo does bar
 */
create procedure my_proc(foo varchar(100)
...
GO

The output is generated as nice-looking HTML. You can specify custom sections for return-values, date and author, or include usage-guidelines and code samples in your output. Have fun!

like image 92
der Michi Avatar answered Nov 04 '22 19:11

der Michi


The SQL Refactor tool together with the SQL Prompt tool from Red gate Might have what you are looking for. link I have used it a long time ago to document my own Stored Procs

like image 20
Josef Van Zyl Avatar answered Nov 04 '22 20:11

Josef Van Zyl