Microsoft SQL Server
Catalog databases, schemas, tables, views, columns, keys, stored procedures and functions, with SQL lineage from T-SQL views and procedures.
Capabilities
| Capability | Support | Notes |
|---|---|---|
| Tables, views & columns | Supported | |
| Keys, constraints & indexes | Supported | |
| Procedures & functions | Supported | Use sys.sql_modules for the full T-SQL body: INFORMATION_SCHEMA.ROUTINES truncates definitions at 4000 characters. |
| Data lineage | Supported | |
| Lineage from query history | Partial | Statements can be extracted from Query Store (sys.query_store_query_text) with a custom extraction query. |
| Business glossary links | Supported | |
| Data quality probes | Supported | |
| Data profiling | Supported | |
| Data classification | Supported | |
| Chat with your data | Supported |
Connection settings
Create the connection on the Blindata Agent from Settings > Agents > Connections with the connection wizard, choosing Microsoft SQL Server in the technology step.
| Driver class | com.microsoft.sqlserver.jdbc.SQLServerDriver |
|---|---|
| JDBC URL | jdbc:sqlserver://localhost:1433;databaseName=master |
| Authentication |
Service principal (shared technical user) User principal (personal credentials, BYOC) Ephemeral credentials (asked at each run)
|
| Crawling strategy | SQL |
The driver is included in the Blindata Agent: no installation is needed. Driver properties can be added under Advanced settings in the connection wizard.
Prerequisites & permissions
- A Blindata Agent installed with network access to Microsoft SQL Server.
- A login mapped to a user in each database to document.
VIEW DEFINITIONon the database (or schemas) to read view and procedure bodies.VIEW DATABASE STATEto read Query Store.db_datareader(orSELECTon tables) for data quality, profiling and Chat with your data.
Set up metadata crawling
- Create the connection to Microsoft SQL Server on the agent (see Connection settings) and use Test to verify it.
- Create or open the system that represents Microsoft SQL Server in the catalog and link it to the connection.
- In the CRAWLING tab add a crawling job with strategy SQL and, if needed, replace the default queries with the ones suggested below.
- Run a TEST to check the number of extracted objects, then RUN or schedule the job.
The job options and the column aliases of every extraction query are described in the Generic JDBC reference.
Suggested extraction queries
The default SQL strategy queries on INFORMATION_SCHEMA work for tables, views, columns and constraints of the database set in the connection URL. Create one crawling job per database to document. The following queries add table descriptions and full routine definitions.
Tables query
Tables and views with their MS_Description extended property:
SELECT
s.name AS table_schema,
o.name AS table_name,
CASE o.type WHEN 'U' THEN 'TABLE' ELSE 'VIEW' END AS table_type,
CAST(ep.value AS NVARCHAR(4000)) AS description
FROM sys.objects o
JOIN sys.schemas s ON s.schema_id = o.schema_id
LEFT JOIN sys.extended_properties ep
ON ep.class = 1
AND ep.major_id = o.object_id
AND ep.minor_id = 0
AND ep.name = 'MS_Description'
WHERE o.type IN ('U', 'V')
AND o.is_ms_shipped = 0
Routines query
Procedures and functions with their T-SQL definition from sys.sql_modules (not truncated) and their parameters as JSON:
SELECT
o.name AS SPECIFIC_NAME,
DB_NAME() AS ROUTINE_CATALOG,
s.name AS ROUTINE_SCHEMA,
o.name AS ROUTINE_NAME,
CASE WHEN o.type = 'P' THEN 'PROCEDURE' ELSE 'FUNCTION' END AS ROUTINE_TYPE,
m.definition AS ROUTINE_DEFINITION,
COALESCE((
SELECT
p.name AS [name],
TYPE_NAME(p.user_type_id) AS [dataType],
p.parameter_id - 1 AS [positionIndex]
FROM sys.parameters p
WHERE p.object_id = o.object_id
AND p.parameter_id > 0
AND p.is_output = 0
ORDER BY p.parameter_id
FOR JSON PATH
), '[]') AS ROUTINE_PARAMETERS,
o.create_date AS CREATED,
o.modify_date AS LAST_ALTERED
FROM sys.objects o
JOIN sys.schemas s ON s.schema_id = o.schema_id
JOIN sys.sql_modules m ON m.object_id = o.object_id
WHERE o.type IN ('P', 'FN', 'IF', 'TF')
AND o.is_ms_shipped = 0
sys.sql_modules.definition contains the complete CREATE PROCEDURE / CREATE FUNCTION statement. For table-valued function lineage
the definition must be the analyzable body: strip the header in the query (for example from the AS keyword that starts the body) or with the bucket pre-processing rules.