Stop manually exporting query results, editing spreadsheets, and hoping nothing breaks.
SqlXL lets you bulk insert or update SQL Server data from Excel — with full validation using your existing database constraints.
- No manual scripts
- No fragile copy/paste workflows
- No partial imports or silent data corruption
Built for SQL Server developers and data professionals who rely on Excel but need production-safe results.
If you've ever:
- Exported query results to Excel just to clean them up
- Manually edited data before re-importing it
- Worried about bad data making it into your database
- Written one-off scripts for bulk updates
Then you already know the problem.
SqlXL replaces that entire workflow with something safe, repeatable, and fast.
Website: runsqlxl.com
dotnet tool install --global SqlXlRequires .NET 10.0 or later. Windows only.
sqlxl init --connection "Server=myserver;Database=MyDB;Integrated Security=true;TrustServerCertificate=true;"Installs SqlXL infrastructure into your database and saves the connection as your default profile. You won't need --connection on subsequent commands.
Want to try it before touching your own database?
sqlxl demo --connection "Server=localhost;Integrated Security=true;TrustServerCertificate=true;"
sqlxl init --connection "Server=localhost;Database=SqlXlDemo;Integrated Security=true;TrustServerCertificate=true;" --profile demo
sqlxl use demo
sqlxl insert --table dbo.ProductsHave a spreadsheet but no destination table yet?
sqlxl infer your-data.xlsx --output schema.sql
# review schema.sql, edit if needed, then apply it (sqlcmd, SSMS, etc.)
sqlxl insert --table dbo.YourTable --file your-data.xlsx(Assumes sqlxl init has been run against your database. infer itself is connectionless — it reads the local xlsx and emits text.)
Have a spreadsheet but no destination table yet? infer reads the file and emits a CREATE TABLE statement with column types inferred from the data. The DDL is for you to review and run yourself — infer never executes it.
# Print DDL to stdout (pipe-friendly)
sqlxl infer products.xlsx --sheet Products --table Products
# Write DDL to a file plus a JSON inference report
sqlxl infer products.xlsx --sheet Products --table Products --output products.sql --report products.jsonAfter you apply the DDL (any tool — sqlcmd, SSMS, etc.), the same xlsx loads through the validated sqlxl insert pipeline below. No reformatting needed.
# Generate an empty INSERT template
sqlxl insert --table dbo.Products
# Import a filled template
sqlxl insert --table dbo.Products --file Products_insert_20260412.xlsxNo configuration needed. SqlXL inspects the table and scaffolds everything automatically on first use.
# Generate a pre-populated UPDATE template (all rows)
sqlxl update --table dbo.Products
# Filter which rows to include
sqlxl update --table dbo.Products --where "CategoryName = 'Electronics'"
# Import a filled template
sqlxl update --table dbo.Products --file Products_update_20260412.xlsxFor workflows that span multiple tables, or require custom validation logic, configure a BulkOpFeature in your database and reference it by ID:
# Generate template driven by the feature config
sqlxl import --feature 7
# Import a filled template through the configured processing sproc
sqlxl import --feature 7 --file data.xlsxsqlxl export --query "SELECT * FROM dbo.Products WHERE CategoryID = 3"
sqlxl export --query "SELECT * FROM dbo.Orders" --output orders.xlsxAuto-generates test data and runs it through all configured features for a table. Useful after scaffolding to verify the pipeline end-to-end.
sqlxl test --table dbo.Products
sqlxl test --table dbo.Products --rows 5Creates (or resets) a self-contained demo database with sample tables and data. Safe to run repeatedly — drops and recreates.
sqlxl demo --connection "Server=localhost;Integrated Security=true;TrustServerCertificate=true;"Emits a complete, versioned reference document for the installed binary — commands, flags, workflows, gotchas, and the BulkOpFeature schema — so an AI assistant can operate SqlXL fluently without external lookups.
# Text (markdown) — human-readable
sqlxl llm-context
# JSON — structured, schema-validated, agent-friendly
sqlxl llm-context --format json
# Include live DB state: active profile, configured features, domain tables
sqlxl llm-context --format json --include-statePass the JSON output to your AI assistant at the start of a session. No DB connection required unless --include-state is used.
Data is bulk-copied to a staging table. SQL Server constraints on that table are the validators. If any row fails a constraint, the entire batch is rolled back and row-level error messages are returned to the terminal. No partial imports.
SqlXL stores named connection profiles in ~/.sqlxl/config.json. After sqlxl init, no --connection flag is needed.
# Save additional profiles
sqlxl init --connection "Server=prod;Database=ProdDB;..." --profile prod
sqlxl init --connection "Server=staging;Database=StageDB;..." --profile staging
# Switch the active profile
sqlxl use prod
# List all profiles (shows active with *)
sqlxl connections list
# Remove a profile
sqlxl connections remove stagingPer-command overrides:
# Use a named profile just for this command (doesn't change the active profile)
sqlxl insert --table dbo.Products --profile staging
# Fully explicit connection string (overrides everything)
sqlxl insert --table dbo.Products --connection "Server=...;Database=...;"Resolution order (highest to lowest priority):
--connectionflagSQLXL_CONNECTIONenvironment variable--profileflag- Active profile in
~/.sqlxl/config.json
Security: Windows Auth connection strings (no password) are stored as plain text — there is nothing to protect. SQL Auth connection strings are automatically encrypted with Windows DPAPI, bound to your user account and machine.
By default, profiles live in ~/.sqlxl/config.json. You can override that location for any command — useful for CI/CD pipelines, shared team config files, or running multiple SqlXL configurations side-by-side on the same machine.
# Per-command override
sqlxl insert --table dbo.Products --config /shared/team-sqlxl-config.json
# Persistent override via environment variable
export SQLXL_CONFIG=/shared/team-sqlxl-config.json
sqlxl insert --table dbo.ProductsResolution order for the config file location (highest to lowest priority):
--config <path>flagSQLXL_CONFIGenvironment variable~/.sqlxl/config.json(default)
The override applies to both reads and writes — sqlxl init --config /path/to/file.json will write the new profile to that file.
- .NET 10.0 or later
- SQL Server 2019 or later
- Windows (DPAPI credential storage is Windows-only)
MIT — see LICENSE
Copyright (c) 2026 Chris Hamilton