microsoft/azuresql-db-seed
>- Populates the local Azure SQL Developer database (appdb) with realistic sample/test data so a developer has something to build against. Use when the user says "seed the database", "add test data", "populate the dev database", "generate sample data", "fake data", "load fixtures", "insert test rows", "write a seed script", or "bulk load a CSV". This is the Azure SQL engine (EngineEdition 5), not the mssql/server SQL Server image. Distinct from azuresql-db-scaffold (which does a single seed.sql step while bootstrapping an app) and azuresql-db-import (which loads a .bacpac). Reach for this whenever an existing appdb needs volume, fixtures, or believable rows.
npx skills add https://github.com/microsoft/azure-sql-database-container --skill azuresql-db-seed
Fill an existing appdb with realistic sample data so the app has something to render, query,
and test against. This is the Azure SQL engine (Private Preview), not the SQL Server image.
Use this skill for populating data. For bootstrapping a whole new app use azuresql-db-scaffold;
for restoring an existing .bacpac use azuresql-db-import.
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest (x64 / linux/amd64).
Do NOT use mcr.microsoft.com/mssql/server (the SQL Server image).
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.iofirst with the pull-only credentials from https://aka.ms/sqldbcontainerpreview-signup (they may rotate).
SELECT SERVERPROPERTY('EngineEdition') returns 5 andSERVERPROPERTY('Edition') returns 'SQL Azure'.
ACCEPT_EULA=Y and a complex MSSQL_SA_PASSWORD(example literal used throughout: YourStr0ng_Passw0rd). The engine listens on 1433.
--platform linux/amd64 to docker run.CREATE DATABASE appdb on a masterconnection before you seed anything.
USE appdb to switch databases. In a user-database (SDS) session USE returnsMsg 40508. Always select the target database in the connection string (Database=appdb, or
-d appdb for sqlcmd).
SQL_CONNECTION_STRING. Strings use User Id= / Password= /Database= and TrustServerCertificate=true. sqlcmd uses -C to trust the self-signed cert.
Seeding into a database that does not exist fails. Create appdb on a master connection first:
docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "YourStr0ng_Passw0rd" -C -b \
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;"
If the container is not running yet, start it and provision appdb using the canonical start recipe
in the azuresql-db-scaffold skill, then come back here.
Referential integrity is enforced. A child row whose foreign key points at a parent that does not
exist yet fails with Msg 547 (conflict with the FOREIGN KEY constraint). So insert in dependency
order: parents first, then the rows that reference them.
For a simple dbo.author -> dbo.book model that means: insert authors, capture their ids, then
insert books that reference those author ids. Full copy-pasteable T-SQL is in
references/seed-snippets.md.
Rules of thumb:
first. Repeat until every table is seeded.
IF NOT EXISTS or MERGE, or DELETE children thenparents before re-inserting) so re-running does not duplicate rows or leave orphans.
To create realistic volume (hundreds or thousands of rows) do it set-based with a numbers/tally
approach rather than a row-by-row loop. A tally derived from system views produces a sequence you
join against to fan out rows in a single statement. The runnable example (generate 1000 rows) is in
references/seed-snippets.md. Wrap large inserts in an explicit
transaction so a mid-load failure rolls back cleanly.
Per-stack seed recipes live in references/seed-snippets.md:
dbo.author -> dbo.book) run viadocker exec -i sqldb ... -d appdb -i seed.sql, plus the set-based "generate 1000 rows" example.
BULK INSERT from a CSV and the bcp utility for large data files.@faker-js/faker generating rows, inserted with the mssql driver using parameters.Faker generating rows, inserted with pyodbc (ODBC Driver 18) using parameters.User Id=/Password=/Database=.mcr.microsoft.com/mssql/server; EngineEdition is 5.Msg 547).mcr.microsoft.com/mssql/server) or call a non-x64 host "supported".USE appdb; select the database in the connection string or with -d appdb.BULK INSERT and bcp for CSV/large data, and Node (@faker-js/faker + mssql) and Python (Faker + pyodbc) parameterized inserts. Read it once you know your data source and stack.Authoritative, version-pinned references for the tools this skill uses (read the one you need):
If the Microsoft Learn MCP server is configured, use mcp__microsoft-learn__microsoft_docs_search or mcp__microsoft-learn__microsoft_docs_fetch to fetch the current version of any of these on demand. It is optional; when it is unavailable, the references above are authoritative.
Take microsoft/azuresql-db-seed from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference docker.
Without those the skill loads but fails at the first command.