sqldatadump
generates insert statements with data for tables in a provided SQL Server database.
See the docs here.
go install github.com/cbergoon/sqldatadump
USAGE: Usage: sqldatadump [--directory] [--schema=<schema>] [--batchesPerFile=<batches>] [--rowsPerBatch=<rows>] <username>:<password>@<address>:<port>/<database>
To generate insert statements in a directory called table-data
for tables in the dbo
schema of the AdventureWorks
database with 10 batches per file and 1000 records per batch:
$ sqldatadump --directory=./table-data --schema=dbo --rowsPerBatch=1000 --batchesPerFile=10 --ignoreTables=CarrierRef,MasterLocation '<username>:<password>@127.0.0.1:1433/AdventureWorks'
To use windows authentication:
$ sqldatadump --directory=./table-data --schema=dbo --rowsPerBatch=1000 --batchesPerFile=10 --ignoreTables=CarrierRef,MasterLocation '<domain>\<username>:<password>@127.0.0.1:1433/AdventureWorks'
This project is licensed under the MIT License.