Dataset
SQL Server and Azure SQL database datasets for AI training
A SQL Server dataset is an export of chosen databases from one business's SQL Server instance or Azure SQL Database: the tables behind its line-of-business applications with their rows, the views, and the T-SQL stored procedures, functions and triggers that carry the business logic, plus temporal history tables and change data capture tables where they were switched on. SourceX sources it to a buyer's spec from established businesses that run SQL Server. Each dataset is de-identified and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- Chosen databases from SQL Server or Azure SQL: table rows, object definitions in T-SQL, and row history where it was enabled
- Typical systems
- SQL Server, Azure SQL Database and Azure SQL Managed Instance, with SQL Server Agent, SSIS and Query Store where in scope
- Typical history
- Specified by the buyer; row versions exist only from the day system versioning or change data capture was switched on
- Modality
- Structured table rows; code in stored procedures, functions, triggers, views and Agent job steps
- Delivery formats
- Agreed per order; Parquet or CSV per table with schema DDL and modules as .sql files, or a de-identified .bak or BACPAC
- Preparation
- Personal data replaced with keys that still join; credentials and payment fields removed; free-text columns scrubbed
- Licensing
- Rights reviewed with the database owner, including a packaged application vendor's terms; permitted use set in the license
- Availability
- Sourced to your spec by application type, table count and history features; a matching database is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| database_key | string | Stable pseudonym for one Database, with its collation, compatibility level and whether it ran on SQL Server or Azure SQL. |
| object | object | Schema, name and type of the Table, View, Stored procedure, Function or Trigger, with create and modify dates from sys.objects. |
| columns | array | A Table's columns: data type, nullability, IDENTITY, computed definition, default and any MS_Description extended property. |
| constraints | array | Primary keys, check constraints and foreign keys, with the is_disabled and is_not_trusted flags from sys.foreign_keys. |
| rows | array | The Table's rows, with keys pseudonymized consistently so declared and implied joins still resolve. |
| module_definition | string | The T-SQL text of a Stored procedure, Function, View or Trigger as held in sys.sql_modules. |
| dependencies | array | Objects a module references, including other databases and linked servers that are outside the delivery. |
| period_columns | object | For a Temporal table, the names of its two datetime2 period columns and of its paired history table. |
| history_rows | array | Rows of a Temporal table's history table: each earlier version of a row with the period it was current. |
| change_rows | array | Rows of a Change data capture table in the cdc schema, with its __$start_lsn, __$operation and __$update_mask columns. |
| agent_job_steps | array | SQL Server Agent jobs from msdb, with each step's command text, subsystem and schedule. |
| query_store_entries | array | Query Store query text, plans and runtime statistics per interval, where Query Store was on. |
Field names from the table above; values are masked placeholders.
Example record
{
"database_key": "db_41be07",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"object": {
"schema": "dbo",
"name": "WorkOrder",
"type": "USER_TABLE"
},
"columns": [
{
"name": "WorkOrderID",
"type": "int",
"identity": true
},
{
"name": "CustomerKey",
"type": "int"
},
{
"name": "StatusCode",
"type": "char(2)",
"ms_description": "OP open, HD on hold, CL closed"
},
{
"name": "ValidFrom",
"type": "datetime2(7)",
"generated": "ROW START"
},
{
"name": "ValidTo",
"type": "datetime2(7)",
"generated": "ROW END"
}
],
"constraints": [
{
"name": "FK_WorkOrder_Customer",
"type": "FOREIGN KEY",
"references": "dbo.Customer(CustomerKey)",
"is_disabled": false,
"is_not_trusted": true
}
],
"period_columns": {
"start": "ValidFrom",
"end": "ValidTo",
"history_table": "dbo.WorkOrderHistory"
},
"rows": [
{
"WorkOrderID": 50412,
"CustomerKey": 7300418,
"StatusCode": "CL",
"ValidFrom": "2024-03-18T15:02:44.1830000Z",
"ValidTo": "9999-12-31T23:59:59.9999999Z"
}
],
"history_rows": [
{
"WorkOrderID": 50412,
"CustomerKey": 7300418,
"StatusCode": "OP",
"ValidFrom": "2024-03-04T09:11:20.5570000Z",
"ValidTo": "2024-03-18T15:02:44.1830000Z"
}
],
"module_definition": "CREATE TRIGGER dbo.trg_WorkOrder_Close ON dbo.WorkOrder AFTER UPDATE AS\nBEGIN\n SET NOCOUNT ON;\n INSERT INTO dbo.BillingQueue (WorkOrderID, QueuedAt)\n SELECT i.WorkOrderID, SYSUTCDATETIME()\n FROM inserted AS i JOIN deleted AS d ON d.WorkOrderID = i.WorkOrderID\n WHERE i.StatusCode = 'CL' AND d.StatusCode <> 'CL';\nEND",
"dependencies": [
"dbo.BillingQueue"
]
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Train text-to-SQL on T-SQL
Populated tables with coded columns, nullable fields and untrusted keys test whether a model writes T-SQL that returns the right rows.
Read and migrate procedure logic
Long stored procedures with temp tables, cursors and nested calls are the code agents must explain, test and port.
Reconstruct state as of a date
Temporal history tables let a training example hold what a row said on a given day, and nothing written after.
Learn change sequences
Change data capture rows give ordered inserts, updates and deletes with before and after values.
Evaluate tuning agents
Query Store text, plans and runtime statistics pair real workload queries with how they ran.
Use-case guides: Coding agents, Enterprise and computer-use agents, Finance and accounting agents, Private evaluation sets
What makes this data valuable
Logic delivered with the data
Procedures, triggers, functions and views exported beside the tables they read and write.
History switched on early
Temporal tables enabled for years on the tables that matter, or change capture rows copied out before cleanup removed them.
Trusted constraints
Foreign keys that are enabled and trusted, so the declared join graph matches the rows.
Readable definitions
Modules not created WITH ENCRYPTION, whose text can be read from the catalog.
Documented columns
MS_Description properties or a data dictionary that says what coded columns mean.
Whole dependency set
Every database a procedure reaches by three-part name included or listed as missing.
Record timeline
SQL Server dataset
The rules live in T-SQL, and history lives in a paired table
Applications built on SQL Server tend to put their rules in the database. Posting an invoice or closing a period is often a stored procedure, and side effects such as queueing a bill are triggers that read the inserted and deleted pseudo-tables. The text of all of these sits in sys.sql_modules and can be exported beside the rows it acts on. That pairing is the asset: the code that enforces a rule and the data the rule produced. A module created WITH ENCRYPTION returns no text. And renaming a procedure with sp_rename leaves the old name inside its stored CREATE statement, so scripts read from the catalog can disagree with the object names.
Row history exists only where someone switched it on. A system-versioned temporal table has two datetime2 period columns and a paired history table. On every update or delete, SQL Server moves the old version of the row into the history table and stamps the period, in UTC, during which it was current. History starts on the day versioning was enabled. Inserts write nothing to the history table. No column says who made the change. Period columns can be declared HIDDEN, so a SELECT * extract leaves them out, and a retention policy can trim old versions.
Change data capture is the other source. It writes each insert, update and delete to a table in the cdc schema with an operation code and the before and after images of an update, but a cleanup job deletes those rows after a retention window, so it usually covers a recent stretch and not years. Where neither feature is on, a table holds current values, and history is whatever the application wrote for itself, such as audit tables filled by triggers. A rowversion column proves that a row changed, not when or how.
What a .bak and a BACPAC each carry
A native .bak backup is the most complete copy of one database. It holds every table, module and permission, the history tables and the Query Store. It restores only onto SQL Server of the same or a newer version, never an older one and never onto Azure SQL Database, and a database under Transparent Data Encryption needs its certificate too. It lacks everything kept at server level. SQL Server Agent jobs and their run history are in the msdb database. Logins and linked servers are in master. SSIS packages are in the SSISDB catalog, in msdb or in .dtsx files. A nightly job that runs a chain of procedures is business logic that a backup of one database does not contain.
Azure SQL Database does not hand a customer a native backup file, so its export is a BACPAC, a compressed package of schema and table data. It leaves out the same server-level objects. An export taken from a live database is not a single point in time, so related tables can disagree unless it was taken from a copy. Export can fail when a view or procedure references a missing object or another database, and owners sometimes drop objects to get it through. A DACPAC is the schema package and normally carries no rows. An extract run by a privileged account also returns real values from columns under dynamic data masking, while Always Encrypted columns stay ciphertext without their keys.
To test a sample, load it and check four things. Count foreign keys by is_not_trusted and is_disabled, and look for orphan rows under the untrusted ones. Find module references that point outside the delivery, to other databases or linked servers. For each temporal table, confirm that the history table arrived and that one key's periods run end to start without overlap. Then compare time values with the source. The older datetime type rounds to thousandths of a second ending in 0, 3 or 7, and a pipeline that converted types may have shifted them.
What to check before licensing
- Have the database owner and counsel check Microsoft's license and service terms for SQL Server and Azure SQL as they apply to exporting and licensing the database's contents.
- Ask whether the database belongs to a packaged application, and have counsel check whether that vendor's license restricts use of its schema and stored procedures.
- Establish whose personal data sits in the tables, such as customers, employees or a client's own customers, and whether the owner controls it or only hosts it.
- Confirm that password hashes, API keys, connection strings, card numbers and bank details are removed, including from configuration tables, Agent job steps and literals in procedure text.
- Ask which tables are system-versioned or under change data capture, the date each was enabled, and whether a retention policy or cleanup job has trimmed them.
- Ask how the export was made, from the live database or a copy, by which account, and which objects were dropped to complete it.
- List the server-level items tied to the application, such as Agent jobs, SSIS packages and linked servers, and agree which are in scope.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
Do we receive a .bak file or extracted tables?
Either can be specified, and extracted tables are usually the practical choice, because de-identification is easier to apply and verify table by table than inside a backup. An extract carries each table with the schema as DDL and each module's T-SQL as a file. A .bak or BACPAC can be agreed where the owner de-identifies a restored copy and backs that up.
Are stored procedures and triggers included?
Yes, where the owner has the right to license them and they are readable. In an in-house application the T-SQL belongs to the business. In a packaged product the procedures usually belong to the software vendor, whose license may restrict sharing them, a point for the owner and counsel to check. They can be left out while the owner's rows and custom objects stay in.
How far back does row history go?
Only as far back as a history feature was running. Temporal tables hold earlier row versions from the day system versioning was enabled, and change data capture usually holds a short recent window. Before that, a table shows current values, and history depends on audit tables or date columns the application kept itself. Ask for the enable date per table.
Is Azure SQL Database different from SQL Server here?
The tables and T-SQL are nearly the same. The export route differs. Azure SQL Database exports a BACPAC, not a native backup, and has no SQL Server Agent, so scheduled work is defined in outside services. Azure SQL Managed Instance is closer to the server product. Ask which service the database runs on.
What does Query Store add, and what does it leave out?
Query Store adds the text of queries the database ran, their execution plans and runtime statistics summed per time interval. It does not hold one row per execution or who ran a query. Literals typed into ad hoc queries stay in the text and need masking. Ask whether it was on and whether older entries were purged.
Is SourceX affiliated with Microsoft?
SQL Server and Azure SQL Database are named to identify the system the records come from. That does not imply a partnership with or endorsement by Microsoft. The records belong to the business that runs SQL Server or Azure SQL Database, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Relational business database exports
Populated relational databases from business applications, with schema, keys, constraints, code tables and a data dictionary
- Database schemas, migrations and stored procedures
Production schema definitions with the migration chain, procedural code and the review and rollback record
- ERP transaction histories across modules
One company's ERP documents across modules, with flow links, change logs, master data and the data dictionary
- PostgreSQL application databases
A pg_dump of chosen schemas: table rows, declared constraints, views, functions, triggers and the application's own audit or history tables
- Oracle Database schemas
Chosen schemas exported with table rows, LOBs, data dictionary definitions and PL/SQL source, converted to open formats on request
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.