Microsoft SQL Server
Official · maintained by Marmotmarmotdata/mssql Discover databases, tables, views and routines from Microsoft SQL Server instances
The SQL Server plugin discovers databases, tables, views, stored procedures and functions from Microsoft SQL Server, Azure SQL Database and Azure SQL Edge instances.
It uses the pure-Go github.com/microsoft/go-mssqldb driver, so it needs no cgo and no ODBC driver on the host. SQL authentication works with a plain login, and Windows authentication works by giving the login as DOMAIN\user.
Databases
A SQL Server session is bound to a single database, so the plugin opens one connection per database. By default it discovers every database the login can open, minus master, model, msdb and tempdb. Set database to discover just one.
Because one instance holds many databases and two of them can hold the same schema and object name, tables, views and routines are named database.schema.object.
Encryption
encrypt: true requires an encrypted connection. A default SQL Server install presents a self-signed certificate, which fails verification, so pair it with trust_server_certificate: true or install a certificate the client trusts. encrypt: false turns encryption off entirely.
Comments
SQL Server has no COMMENT ON, so descriptions come from MS_Description extended properties on schemas, tables, views and columns. Objects without one have no description.
Query history
Query history is not read. Usage-based lineage would need the plan cache or Query Store, which are per-database, expensive to scan and often disabled. Lineage comes from foreign keys and view definitions instead.
In the UI
Point-and-click, no config file needed.
- 1 Open Runs Create pipeline
- 2 Pick Microsoft SQL Server from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-mssql-pipeline
runs:
- mssql:
host: "<host>"
user: "<user>"
password: "***"$ marmot ingest -c ingest.yamlNot using plugins? Other ways to populate Marmot
Configuration
19 top-level fields. * marks required fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
host string SQL Server hostname or IP address
port int SQL Server port
- default
- 1433
user string Login to authenticate with. Use DOMAIN\user for Windows authentication
password password Password for the login
database string Discover only this database. Leave empty to discover every database the login can open
exclude_databases multiselect Databases to skip
- default
- ["master","model","msdb","tempdb"]
exclude_schemas multiselect Schemas to skip
- default
- ["sys","INFORMATION_SCHEMA","guest","db_owner","db_accessadmin","db_securityadmin","db_ddladmin","db_backupoperator","db_datareader","db_datawriter","db_denydatareader","db_denydatawriter"]
encrypt bool Require an encrypted connection
- default
- true
trust_server_certificate bool Accept the server certificate without verifying it. Needed for self-signed certificates
- default
- false
connect_timeout_seconds int Seconds to wait for a connection
- default
- 30
application_intent select Connect to a read-only replica with ReadOnly
- default
- ReadWrite
include_columns bool Whether to include column information
- default
- true
include_views bool Whether to discover views
- default
- true
include_procedures bool Whether to discover stored procedures and functions
- default
- true
discover_foreign_keys bool Whether to discover foreign key relationships
- default
- true
include_statistics bool Whether to collect row counts and table sizes
- default
- true
Assets emitted
Metadata this plugin attaches to each discovered asset.
Database
MSSQLDatabaseFieldsThe metadata fields the SQL Server plugin emits for database assets.
host stringSQL Server hostname or IP address
port intSQL Server port
database stringDatabase name
database_id intDatabase id within the instance
collation stringDatabase collation
recovery_model stringRecovery model (SIMPLE, FULL, BULK_LOGGED)
state stringDatabase state, always ONLINE for a discovered database
created stringWhen the database was created
owner stringLogin that owns the database
server_version stringInstance product version
edition stringInstance edition
schema_count intNumber of discovered schemas
table_count intNumber of discovered tables
view_count intNumber of discovered views
Table
MSSQLTableFieldsThe metadata fields emitted for table and view assets.
host stringSQL Server hostname or IP address
port intSQL Server port
database stringDatabase holding the object
schema stringSchema holding the object
table_name stringTable or view name, without the database and schema
object_type stringObject type (user_table, view)
comment stringMS_Description extended property on the object
schema_comment stringMS_Description extended property on the schema
created stringWhen the object was created
modified stringWhen the object was last altered
Function
MSSQLFunctionFieldsThe metadata fields emitted for stored procedure and function assets.
host stringSQL Server hostname or IP address
port intSQL Server port
database stringDatabase holding the routine
schema stringSchema holding the routine
object_type stringRoutine type (stored_procedure, scalar_function, inline_table_function, table_function)
created stringWhen the routine was created
modified stringWhen the routine was last altered
encrypted boolWhether the routine body is encrypted and so unreadable
Column
MSSQLColumnFieldsThe per-column fields embedded in an asset's schema.
column_name stringColumn name
data_type stringColumn type as SQL Server declares it, for example nvarchar(100) or decimal(10,2)
is_nullable boolWhether null values are allowed
is_primary_key boolWhether the column is part of the primary key
description stringMS_Description extended property on the column
default_expression stringDefault constraint expression
is_identity boolWhether the column is an IDENTITY column
identity_seed intFirst value an IDENTITY column produces
identity_increment intStep between IDENTITY values
is_computed boolWhether the column is computed from other columns
is_persisted boolWhether a computed column is stored rather than evaluated on read
computed_definition stringExpression a computed column is derived from
collation stringColumn collation for text types