DictionaryLeap

Guide

A SQL Server data dictionary from your schema

A SQL Server data dictionary lists each table and view, and each column on it: the schema, the name, the data type, whether the column allows null, and any description stored as the MS_Description extended property. It describes structure. It does not contain the rows stored in those columns.

The same catalog views are what you use on Azure SQL Database and Azure SQL Managed Instance. DictionaryLeap does not connect to the server. Run the read-only query below in the database you want to document, save the result as a CSV with the header row, and upload that file. The upload reads table_name, column_name, and data_type. table_schema and is_nullable are used when they are present. A description cell stays in the file so you can compare it with the draft. The upload does not copy that cell into the dictionary.

The free preview shows the first 25 columns and the first glossary domain. The Dataset Pack is $49 for one table of up to 200 columns, with a flat glossary plus one domain of the hierarchy, and a glossary CSV and SKOS for that domain. The Database Pack is $249 for up to 50 tables and 2,000 columns, with the full glossary and taxonomy hierarchy, all parent and child checks, an Excel glossary sheet, a glossary CSV, and SKOS. Each pack is a one-time price for that upload. It is not a subscription, and nothing renews.

What the dictionary covers

Schema and table or view. INFORMATION_SCHEMA.COLUMNS returns objects in the current database. The query leaves out the sys and INFORMATION_SCHEMA schemas.

Column name and DATA_TYPE. DATA_TYPE is the type name, such as int or varchar. Length and precision are other columns on that view. This query does not select them.

IS_NULLABLE. The upload reads YES or NO. Any other value leaves nullability empty.

description, from sys.extended_properties where the property name is MS_Description. The property value is sql_variant. The query converts it to nvarchar(4000), so a longer description is shortened in this export. An empty description means the property is not set, or the column could not be matched in sys.columns.

Primary and foreign keys are not in this query. The schema export guide has a SQL Server query that includes keys and does not select descriptions.

What the CSV should contain

Use these header names. Letter case does not matter. A catalog file needs table_name, column_name, and data_type (or udt_name). The other columns are optional.

ColumnRequiredWhat it is
table_schemaNoSchema name. Keeps two tables with the same name apart.
table_nameYesTable or view name.
column_nameYesColumn name.
data_typeYesType name, without length. udt_name is accepted only when data_type is absent.
is_nullableNoYES or NO. Other text leaves nullability empty.
descriptionNoMS_Description for the column, shortened to 4000 characters. The upload does not copy this cell. Keep it so you can compare it with the draft.

How to do it

  1. Open the database. Connect to SQL Server or Azure SQL and select the database you want to document. The views in this query are scoped to the current database.
  2. Run the query. Run the single SELECT. It reads INFORMATION_SCHEMA.COLUMNS, sys.columns, and sys.extended_properties. It does not select rows from your tables.
  3. Save the CSV. Save the result as a CSV with the header row.
  4. Start the preview. Upload the file on the build page. Leave sample values off. DictionaryLeap does not connect to SQL Server or Azure SQL.

Read-only SQL

Run one query. Save the result as a CSV with the header row. Do not include a dump of table rows.

INFORMATION_SCHEMA.COLUMNS and MS_Description

Run this in the database you want to document. INFORMATION_SCHEMA.COLUMNS and sys.extended_properties both refer to the current database. The current Microsoft page for sys.extended_properties applies to SQL Server, Azure SQL Database, Azure SQL Managed Instance, Azure Synapse Analytics, and Microsoft Fabric SQL analytics endpoint and Warehouse. This query was checked against that page. It was not run on a server.

For class 1, that page says major_id is the object id, and minor_id is the column_id for a column, or 0 for the object itself. This query does not use ORDINAL_POSITION as that id. It matches sys.columns by column name, then matches minor_id to column_id. A table-level MS_Description has minor_id 0, so it is not copied onto every column.

QUOTENAME wraps the schema and table names before OBJECT_ID looks them up. The filter keeps the property named MS_Description. The page says the property name is unique for a class, major_id, and minor_id, so the join keeps one description per column. Other property names are not selected.

Add AND c.TABLE_SCHEMA = N'dbo' when you only want that schema. Use your schema name. Catalog visibility follows the permissions of the login. The extended-properties page says metadata is limited to securables the user owns or has some permission on.

Current database

SELECT
  c.TABLE_SCHEMA AS table_schema,
  c.TABLE_NAME AS table_name,
  c.COLUMN_NAME AS column_name,
  c.DATA_TYPE AS data_type,
  c.IS_NULLABLE AS is_nullable,
  CONVERT(nvarchar(4000), ep.value) AS description
FROM INFORMATION_SCHEMA.COLUMNS AS c
LEFT JOIN sys.columns AS sc
  ON sc.object_id = OBJECT_ID(QUOTENAME(c.TABLE_SCHEMA) + N'.' + QUOTENAME(c.TABLE_NAME))
 AND sc.name = c.COLUMN_NAME
LEFT JOIN sys.extended_properties AS ep
  ON ep.class = 1
 AND ep.major_id = sc.object_id
 AND ep.minor_id = sc.column_id
 AND ep.name = N'MS_Description'
WHERE c.TABLE_CATALOG = DB_NAME()
  AND c.TABLE_SCHEMA NOT IN (N'sys', N'INFORMATION_SCHEMA')
ORDER BY c.TABLE_SCHEMA, c.TABLE_NAME, c.ORDINAL_POSITION;

Save the result as a CSV with the header row. description is nvarchar(4000). A longer MS_Description is shortened. This statement does not select primary or foreign keys.

The schema export guide has the SQL Server query for primary and foreign keys. That query does not select MS_Description. Upload this CSV when you want the descriptions. Upload that CSV when you want the keys.

Sensitivity flags and the glossary

Paid packs include Excel, Word, Markdown, and an editable dbt schema.yml. The free preview shows the first 25 columns on screen, with a watermark, and the first glossary domain. Exports stay off. DictionaryLeap picks the pack from the file. You do not choose a price.

The Dataset Pack glossary is a flat glossary plus one domain of the hierarchy, with a glossary CSV and SKOS for that domain. The Database Pack includes the full glossary and taxonomy hierarchy, all parent and child checks, an Excel glossary sheet, a glossary CSV, and SKOS. Definitions are drafts for a data owner to confirm.

DictionaryLeap flags potential sensitivity from the column name. The tag is potential. It is not legal advice, and this query does not select row values, so the file has no sample of what the column stores.

Healthcare, Financial services, and Retail are optional industry presets on the upload form. A preset adds terms and sensitivity rules when column names match. Any other choice uses the General preset. The preset does not change the price.

The description column is the MS_Description text from the server. The catalog upload does not copy that cell into the dictionary. Compare it with the draft after you download a pack. An empty description is fine. Names and types are enough to start. When you also need keys, use the SQL Server query on the schema export guide and upload that file instead. That query does not include descriptions.

Questions about a file or a charge: contact@logicalleap.io.

FAQ

Start the free preview

The free preview shows the first 25 columns and the first glossary domain. The Dataset Pack is $49 for one table of up to 200 columns, with a flat glossary plus one domain of the hierarchy, and a glossary CSV and SKOS for that domain. The Database Pack is $249 for up to 50 tables and 2,000 columns, with the full glossary and taxonomy hierarchy, all parent and child checks, an Excel glossary sheet, a glossary CSV, and SKOS. Each pack is a one-time price for that upload. It is not a subscription, and nothing renews.

Start the free preview