View on GitHub


TSQL scripts for optimizing storage and data types on SQL Server, especially Express edition



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.

It documents:


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 file:

    sqlcmd -S localhost -d master -Q "exec sp_doc @DatabaseName = 'WideWorldImporters';" -o -y 0


Output for the WideWorldImporters database.