SqlDump.Sources 1.4.0

dotnet add package SqlDump.Sources --version 1.4.0                
NuGet\Install-Package SqlDump.Sources -Version 1.4.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SqlDump.Sources" Version="1.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlDump.Sources --version 1.4.0                
#r "nuget: SqlDump.Sources, 1.4.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SqlDump.Sources as a Cake Addin
#addin nuget:?package=SqlDump.Sources&version=1.4.0

// Install SqlDump.Sources as a Cake Tool
#tool nuget:?package=SqlDump.Sources&version=1.4.0                

SqlDump

Simple SQL Server database dumper. Shipped as source-only NuGet package.

Installing

  • Package Manager: Install-Package SqlDump.Sources
  • .NET command line: dotnet add package SqlDump.Sources

Example

private void GenerateBackupScript(string connectionString, string outputFile)
{
    var dumper = new SqlDumper.Dumper(connectionString);
    dumper.IgnoredTableNames = new[] { "__EFMigrationsHistory", "sysdiagrams" };
    using (var writer = File.CreateText(outputFile))
    {
        dumper.Dump(writer);
    }
}

See result

Lecacy System.Data.SqlClient

Add SQL_CLIENT_LEGACY to project defines.

ProgressChanged event

    dumper.ProgressChanged += (sender, e) =>
    {
        if (e.RowsDumped == 0)
        {
            logWriter.WriteLine($"Dumping {e.SchemaName}.{e.TableName}...");
        }
        if (e.RowsDumped > 0 && (e.IsCompleted || e.RowsDumped % 10000 == 0))
        {
            logWriter.WriteLine($"{e.RowsDumped} rows dumped...");
        }
        if (e.IsCompleted)
        {
            logWriter.WriteLine($"The table {e.SchemaName}.{e.TableName} has been dumped");
        }
    };
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 1,770 5/16/2023
1.3.0 3,616 5/24/2021
1.2.0 358 5/24/2021
1.1.0 2,261 6/15/2020
1.0.0 1,797 4/9/2019
0.0.3 601 3/26/2019
0.0.2 597 3/25/2019
0.0.1 588 3/23/2019