Insert XML serialized datasets into MSSQL DBs.
DataSet2Sql is a fast, interactive CLI tool that reads .NET DataSets serialized as XML and automatically recreates them in a Microsoft SQL Server database.
It handles table creation, data type mapping, and fast data insertion using SqlBulkCopy, allowing you to quickly restore datasets without writing manual SQL scripts.
- Automated Schema Creation: Automatically reads the XML dataset and maps .NET types to SQL Server types to create tables.
- Fast Imports: Uses
SqlBulkCopyfor highly performant, batch data insertion. - Interactive CLI: Built with
Spectre.Console, providing helpful, beautiful prompts if arguments are missing. - Safety Checks: Confirms before dropping existing databases, preventing accidental data loss (can be bypassed with
--yes). - Configuration Management: Manage database credentials cleanly via a local configuration file.
irm https://github.com/FelixDamrau/DataSet2Sql/releases/latest/download/dataset2sql-installer.ps1 | iexcurl --proto '=https' --tlsv1.2 -LsSf https://github.com/FelixDamrau/DataSet2Sql/releases/latest/download/dataset2sql-installer.sh | shRun DataSet2Sql config init to create a default config file. This file stores your target MSSQL connection details.
| Platform | Path |
|---|---|
| Linux | ~/.config/DataSet2Sql/dataset2sql.settings.json |
| macOS | ~/Library/Application Support/DataSet2Sql/dataset2sql.settings.json |
| Windows | %APPDATA%\DataSet2Sql\dataset2sql.settings.json |
Example config:
{
"DatabaseSettings": {
"Server": "localhost",
"Name": "DumpDb",
"Username": "dbUser",
"Password": "userPass"
}
}Find your active config path anytime by running:
DataSet2Sql config pathRun the tool without arguments to enter the interactive prompt:
DataSet2SqlOr just pass arguments via the CLI:
DataSet2Sql import --xml ./dump.xml --db MyDatabase --yes