The goal of this script is to generate tables using Git style Markdown from extended properties of common database objects. This allows for a free, extensible way to have a self-documenting database that can generate its own readme file.
- Stored Procedures
- Inline Table Functions - To be implemented
- Scalar Functions - To be implemented
- Triggers - To be implemented
- Default Constraints - To be implemented
- Check Constraints - To be implemented
The only parameter for this procedure is a database name, since the primary scenario for this is to be included in a utility database:
EXEC dbo.sp_doc @dbname = 'AdventureWorks'
To prevent data truncation, unwanted headers, etc. it can be called via sqlcmd to output directly to a readme.md file:
sqlcmd -S localhost -d master -Q "exec sp_doc @DatabaseName = 'WideWorldImporters';" -o readme.md -y 0
Output for the WideWorldImporters database.